diff options
author | Theodore Ts'o <tytso@mit.edu> | 2008-01-27 20:09:05 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2008-01-27 20:09:05 -0500 |
commit | 428f6b32a9029e1f0bc2559233954955a6aae64c (patch) | |
tree | 69a22eeed287318371f415a568eaf30a9993e1ca /e2fsck/super.c | |
parent | 8c7c6eb1675b327387a24bc05ac98dfc890f8073 (diff) | |
parent | c8a5708db1bc66aa361d38e9c74aea929b793921 (diff) | |
download | e2fsprogs-428f6b32a9029e1f0bc2559233954955a6aae64c.tar.gz |
Merge branch 'maint' into next
Conflicts:
configure
lib/ext2fs/ext2_fs.h
misc/e2image.c
Diffstat (limited to 'e2fsck/super.c')
-rw-r--r-- | e2fsck/super.c | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/e2fsck/super.c b/e2fsck/super.c index dbd7b1ac..b93ec955 100644 --- a/e2fsck/super.c +++ b/e2fsck/super.c @@ -778,8 +778,26 @@ void check_super_block(e2fsck_t ctx) /* * Check to see if we should backup the master sb to the backup super - * blocks. + * blocks. Returns non-zero if the sb should be backed up. */ + +/* + * A few flags are set on the fly by the kernel, but only in the + * primary superblock. This is actually a bad thing, and we should + * try to discourage it in the future. In particular, for the newer + * ext4 files, especially EXT4_FEATURE_RO_COMPAT_DIR_NLINK and + * EXT3_FEATURE_INCOMPAT_EXTENTS. So some of these may go away in the + * future. + * + * The kernel will set EXT2_FEATURE_COMPAT_EXT_ATTR, but + * 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. + */ +#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) + int check_backup_super_block(e2fsck_t ctx) { ext2_filsys fs = ctx->fs; @@ -819,10 +837,18 @@ int check_backup_super_block(e2fsck_t ctx) continue; } -#define SUPER_DIFFERENT(x) (fs->super->x != tfs->super->x) +#define SUPER_INCOMPAT_DIFFERENT(x) \ + (( fs->super->x & ~FEATURE_INCOMPAT_IGNORE) != \ + (tfs->super->x & ~FEATURE_INCOMPAT_IGNORE)) +#define SUPER_RO_COMPAT_DIFFERENT(x) \ + (( fs->super->x & ~FEATURE_RO_COMPAT_IGNORE) != \ + (tfs->super->x & ~FEATURE_RO_COMPAT_IGNORE)) +#define SUPER_DIFFERENT(x) \ + (fs->super->x != tfs->super->x) + if (SUPER_DIFFERENT(s_feature_compat) || - SUPER_DIFFERENT(s_feature_incompat) || - SUPER_DIFFERENT(s_feature_ro_compat) || + SUPER_INCOMPAT_DIFFERENT(s_feature_incompat) || + SUPER_RO_COMPAT_DIFFERENT(s_feature_ro_compat) || SUPER_DIFFERENT(s_blocks_count) || SUPER_DIFFERENT(s_inodes_count) || memcmp(fs->super->s_uuid, tfs->super->s_uuid, |