summaryrefslogtreecommitdiffstats
path: root/fs/jffs2/xattr.c
diff options
context:
space:
mode:
authorJean-Christophe DUBOIS <jcd@tribudubois.net>2012-05-10 17:14:03 +0200
committerDavid Woodhouse <David.Woodhouse@intel.com>2012-05-13 23:32:36 -0500
commit8c5a0366403f5dbca9d4ccf50f95bafbaddc2844 (patch)
tree6955c7e9b1520ab89dc26f62fc9e11997c31078c /fs/jffs2/xattr.c
parent9824f75d56298e5fe4f9f57d9f3abd5fbf3d472c (diff)
downloadtalos-op-linux-8c5a0366403f5dbca9d4ccf50f95bafbaddc2844.tar.gz
talos-op-linux-8c5a0366403f5dbca9d4ccf50f95bafbaddc2844.zip
jffs2: allow to complete xattr integrity check on first GC scan
Unlike file data integrity the xattr data integrity was not checked before some explicit access to the attribute was made. This could leave in the system a number of corrupted extended attributes which will be detected only at access time and possibly at a very late time compared to the time the corruption actually happened. This patch adds the ability to check for extended attribute integrity on first GC scan pass (similar to file data integrity check). This allows for all present attributes to be completly verified before any use of them. In order to work correctly this patch also needs the patch allowing JFFS2 to discriminate between recoverable and non recoverable errors on extended attributes. Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'fs/jffs2/xattr.c')
-rw-r--r--fs/jffs2/xattr.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/jffs2/xattr.c b/fs/jffs2/xattr.c
index c18c0ab70ea4..3034e970eb9a 100644
--- a/fs/jffs2/xattr.c
+++ b/fs/jffs2/xattr.c
@@ -437,6 +437,8 @@ static void unrefer_xattr_datum(struct jffs2_sb_info *c, struct jffs2_xattr_datu
* is called to release xattr related objects when unmounting.
* check_xattr_ref_inode(c, ic)
* is used to confirm inode does not have duplicate xattr name/value pair.
+ * jffs2_xattr_do_crccheck_inode(c, ic)
+ * is used to force xattr data integrity check during the initial gc scan.
* -------------------------------------------------- */
static int verify_xattr_ref(struct jffs2_sb_info *c, struct jffs2_xattr_ref *ref)
{
@@ -684,6 +686,11 @@ static int check_xattr_ref_inode(struct jffs2_sb_info *c, struct jffs2_inode_cac
return rc;
}
+void jffs2_xattr_do_crccheck_inode(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic)
+{
+ check_xattr_ref_inode(c, ic);
+}
+
/* -------- xattr subsystem functions ---------------
* jffs2_init_xattr_subsystem(c)
* is used to initialize semaphore and list_head, and some variables.
OpenPOWER on IntegriCloud