[JFFS2][XATTR] Handling the duplicate JFFS2_NODETYPE_XATTR node cases.

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Sun May 21 14:59:08 EDT 2006


Commit:     c8708a9275928cc8e77bd443cd12565dda0a3ded
Parent:     dea80134dc4d54df52c0c59b0ba2bb5aa999bf30
Author:     KaiGai Kohei <kaigai at ak.jp.nec.com>
AuthorDate: Sat May 13 15:21:38 2006 +0900
Commit:     KaiGai Kohei <kaigai at ak.jp.nec.com>
CommitDate: Sat May 13 15:21:38 2006 +0900

    [JFFS2][XATTR] Handling the duplicate JFFS2_NODETYPE_XATTR node cases.
    
    When jffs2_sum_process_sum_data() found a JFFS2_NODETYPE_XATTR
    which has duplicate xid and older version, an error was returned
    without appropriate process.
    In the result, mounting filesystem is failed.
    
    This patch fix this problem. If jffs2_setup_xattr_datum() returned
    -EEXIST, the caller marks this node as DIRTY_SPACE().
    
    [1/2] jffs2-xattr-v5.2-01-fix-duplicate-xdatum.patch
    
    Signed-off-by: KaiGai Kohei <kaigai at ak.jp.nec.com>

 fs/jffs2/summary.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/fs/jffs2/summary.c b/fs/jffs2/summary.c
index 831a42c..9763d73 100644
--- a/fs/jffs2/summary.c
+++ b/fs/jffs2/summary.c
@@ -508,8 +508,14 @@ #ifdef CONFIG_JFFS2_FS_XATTR
 				xd = jffs2_setup_xattr_datum(c, je32_to_cpu(spx->xid),
 								je32_to_cpu(spx->version));
 				if (IS_ERR(xd)) {
-					JFFS2_NOTICE("allocation of xattr_datum failed\n");
 					jffs2_free_raw_node_ref(raw);
+					if (PTR_ERR(xd) == -EEXIST) {
+						/* a newer version of xd exists */
+						DIRTY_SPACE(je32_to_cpu(spx->totlen));
+						sp += JFFS2_SUMMARY_XATTR_SIZE;
+						break;
+					}
+					JFFS2_NOTICE("allocation of xattr_datum failed\n");
 					kfree(summary);
 					return PTR_ERR(xd);
 				}



More information about the linux-mtd-cvs mailing list