From 9a083af71a2388ae47252f8af2b796f9055f4af7 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sat, 15 Dec 2007 19:39:37 -0500 Subject: [PATCH] ext2fs_flushfs: Remove the NEEDS_RECOVERY from the backup superblocks Now that e2fsck tries to backup the primary superblock to the backups when the feature sets ar different, it's important when tune2fs writes out a changed superblock, that we filter out the EXT3_FEATURE_INCOMPAT_RECOVER feature to the backup superblocks, since it will be removed from the primary superblock either when the filesystem is mounted uncleanly or when journal is replayed. Addresses-Debian-Bug: #454926 Signed-off-by: "Theodore Ts'o" --- lib/ext2fs/closefs.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/ext2fs/closefs.c b/lib/ext2fs/closefs.c index f3fe533..88c515a 100644 --- a/lib/ext2fs/closefs.c +++ b/lib/ext2fs/closefs.c @@ -208,6 +208,7 @@ errcode_t ext2fs_flush(ext2_filsys fs) dgrp_t i,j; errcode_t retval; unsigned long fs_state; + __u32 feature_incompat; struct ext2_super_block *super_shadow = 0; struct ext2_group_desc *group_shadow = 0; struct ext2_group_desc *s, *t; @@ -217,6 +218,7 @@ errcode_t ext2fs_flush(ext2_filsys fs) EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS); fs_state = fs->super->s_state; + feature_incompat = fs->super->s_feature_incompat; fs->super->s_wtime = fs->now ? fs->now : time(NULL); fs->super->s_block_group_nr = 0; @@ -254,6 +256,7 @@ errcode_t ext2fs_flush(ext2_filsys fs) * we write out the backup superblocks.) */ fs->super->s_state &= ~EXT2_VALID_FS; + fs->super->s_feature_incompat &= ~EXT3_FEATURE_INCOMPAT_RECOVER; #ifdef EXT2FS_ENABLE_SWAPFS if (fs->flags & EXT2_FLAG_SWAP_BYTES) { *super_shadow = *fs->super; @@ -332,6 +335,7 @@ write_primary_superblock_only: fs->super->s_block_group_nr = 0; fs->super->s_state = fs_state; + fs->super->s_feature_incompat = feature_incompat; #ifdef EXT2FS_ENABLE_SWAPFS if (fs->flags & EXT2_FLAG_SWAP_BYTES) { *super_shadow = *fs->super; -- 1.8.3.1