From 5291bc43c9b0cca050878c353b204824767800e6 Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Fri, 13 Apr 2012 12:25:25 -0600 Subject: [PATCH] e2fsck: ignore xattr feature in backup superblocks Since the xattr feature is enabled automatically by the kernel, it can cause spurious e2fsck runs on a clean filesystem due to differences between the primary and backup superblocks. Signed-off-by: Eric Sandeen Signed-off-by: Andreas Dilger --- e2fsck/super.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/e2fsck/super.c b/e2fsck/super.c index 768316a..30f275c 100644 --- a/e2fsck/super.c +++ b/e2fsck/super.c @@ -905,7 +905,11 @@ void check_super_block(e2fsck_t ctx) * unfortunately, we shouldn't ignore it since if it's not set in the * backup, the extended attributes in the filesystem will be stripped * away. + * + * Well, I'm still going that route for now, 'til I do something + * better. Full-fsck after a fresh install is just no good. -ERS */ +#define FEATURE_COMPAT_IGNORE (EXT2_FEATURE_COMPAT_EXT_ATTR) #define FEATURE_RO_COMPAT_IGNORE (EXT2_FEATURE_RO_COMPAT_LARGE_FILE| \ EXT4_FEATURE_RO_COMPAT_DIR_NLINK) #define FEATURE_INCOMPAT_IGNORE (EXT3_FEATURE_INCOMPAT_EXTENTS| \ @@ -956,6 +960,9 @@ int check_backup_super_block(e2fsck_t ctx) (EXT2_INODE_SIZE(backup_sb) < EXT2_GOOD_OLD_INODE_SIZE)) continue; +#define SUPER_COMPAT_DIFFERENT(x) \ + ((fs->super->x & ~FEATURE_COMPAT_IGNORE) != \ + (backup_sb->x & ~FEATURE_COMPAT_IGNORE)) #define SUPER_INCOMPAT_DIFFERENT(x) \ ((fs->super->x & ~FEATURE_INCOMPAT_IGNORE) != \ (backup_sb->x & ~FEATURE_INCOMPAT_IGNORE)) @@ -965,7 +972,7 @@ int check_backup_super_block(e2fsck_t ctx) #define SUPER_DIFFERENT(x) \ (fs->super->x != backup_sb->x) - if (SUPER_DIFFERENT(s_feature_compat) || + if (SUPER_COMPAT_DIFFERENT(s_feature_compat) || SUPER_INCOMPAT_DIFFERENT(s_feature_incompat) || SUPER_RO_COMPAT_DIFFERENT(s_feature_ro_compat) || SUPER_DIFFERENT(s_blocks_count) || -- 1.8.3.1