diff --git a/fs/jffs2/jffs2.patch b/fs/jffs2/jffs2.patch index eba19047..054bdbf5 100644 --- a/fs/jffs2/jffs2.patch +++ b/fs/jffs2/jffs2.patch @@ -8667,7 +8667,7 @@ diff -Nupr old/fs/jffs2/writev.c new/fs/jffs2/writev.c diff -Nupr old/fs/jffs2/xattr.c new/fs/jffs2/xattr.c --- old/fs/jffs2/xattr.c 2022-05-09 17:15:24.360000000 +0800 +++ new/fs/jffs2/xattr.c 1970-01-01 08:00:00.000000000 +0800 -@@ -1,1347 +0,0 @@ +@@ -1,1352 +0,0 @@ -/* - * JFFS2 -- Journalling Flash File System, Version 2. - * @@ -9442,10 +9442,10 @@ diff -Nupr old/fs/jffs2/xattr.c new/fs/jffs2/xattr.c -} - -#define XREF_TMPHASH_SIZE (128) --void jffs2_build_xattr_subsystem(struct jffs2_sb_info *c) +-int jffs2_build_xattr_subsystem(struct jffs2_sb_info *c) -{ - struct jffs2_xattr_ref *ref, *_ref; -- struct jffs2_xattr_ref *xref_tmphash[XREF_TMPHASH_SIZE]; +- struct jffs2_xattr_ref **xref_tmphash; - struct jffs2_xattr_datum *xd, *_xd; - struct jffs2_inode_cache *ic; - struct jffs2_raw_node_ref *raw; @@ -9454,9 +9454,12 @@ diff -Nupr old/fs/jffs2/xattr.c new/fs/jffs2/xattr.c - - BUG_ON(!(c->flags & JFFS2_SB_FLAG_BUILDING)); - +- xref_tmphash = kcalloc(XREF_TMPHASH_SIZE, +- sizeof(struct jffs2_xattr_ref *), GFP_KERNEL); +- if (!xref_tmphash) +- return -ENOMEM; +- - /* Phase.1 : Merge same xref */ -- for (i=0; i < XREF_TMPHASH_SIZE; i++) -- xref_tmphash[i] = NULL; - for (ref=c->xref_temp; ref; ref=_ref) { - struct jffs2_xattr_ref *tmp; - @@ -9554,6 +9557,8 @@ diff -Nupr old/fs/jffs2/xattr.c new/fs/jffs2/xattr.c - "%u of xref (%u dead, %u orphan) found.\n", - xdatum_count, xdatum_unchecked_count, xdatum_orphan_count, - xref_count, xref_dead_count, xref_orphan_count); +- kfree(xref_tmphash); +- return 0; -} - -struct jffs2_xattr_datum *jffs2_setup_xattr_datum(struct jffs2_sb_info *c,