diff options
author | Theodore Ts'o <tytso@mit.edu> | 2007-10-06 12:37:08 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2007-10-06 12:39:57 -0400 |
commit | 0cfce7f749ea519522929d91e705cf90518594c4 (patch) | |
tree | 475e3ccd8974411defba5238f44da839f014d314 | |
parent | f6341e9c70eb4e0ded51ca96aeaa79a72222c069 (diff) | |
download | e2fsprogs-0cfce7f749ea519522929d91e705cf90518594c4.tar.gz |
e2fsck: update the backup superblocks if the feature bitmasks are changed
If e2fsck adds or deletes any of the feature bitmasks, clear
EXT2_FLAG_MASTER_SB_ONLY so the backup superblocks are updated when
e2fsck finishes.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
-rw-r--r-- | e2fsck/journal.c | 2 | ||||
-rw-r--r-- | e2fsck/pass2.c | 2 | ||||
-rw-r--r-- | e2fsck/super.c | 3 | ||||
-rw-r--r-- | e2fsck/unix.c | 1 |
4 files changed, 7 insertions, 1 deletions
diff --git a/e2fsck/journal.c b/e2fsck/journal.c index 756bbcb2..dbe1bf11 100644 --- a/e2fsck/journal.c +++ b/e2fsck/journal.c @@ -454,6 +454,7 @@ static errcode_t e2fsck_journal_fix_bad_inode(e2fsck_t ctx, sb->s_feature_compat &= ~EXT3_FEATURE_COMPAT_HAS_JOURNAL; sb->s_journal_inum = 0; ctx->flags |= E2F_FLAG_JOURNAL_INODE; + ctx->fs->flags &= ~EXT2_FLAG_MASTER_SB_ONLY; e2fsck_clear_recover(ctx, 1); return 0; } @@ -753,6 +754,7 @@ no_has_journal: e2fsck_clear_recover(ctx, force_fsck); } else if (!(ctx->options & E2F_OPT_READONLY)) { sb->s_feature_compat |= EXT3_FEATURE_COMPAT_HAS_JOURNAL; + ctx->fs->flags &= ~EXT2_FLAG_MASTER_SB_ONLY; ext2fs_mark_super_dirty(ctx->fs); } } diff --git a/e2fsck/pass2.c b/e2fsck/pass2.c index 5e088e2d..f58e5a96 100644 --- a/e2fsck/pass2.c +++ b/e2fsck/pass2.c @@ -267,6 +267,7 @@ void e2fsck_pass2(e2fsck_t ctx) fix_problem(ctx, PR_2_FEATURE_LARGE_FILES, &pctx)) { sb->s_feature_ro_compat |= EXT2_FEATURE_RO_COMPAT_LARGE_FILE; + fs->flags &= ~EXT2_FLAG_MASTER_SB_ONLY; ext2fs_mark_super_dirty(fs); } if (sb->s_rev_level == EXT2_GOOD_OLD_REV && @@ -280,6 +281,7 @@ void e2fsck_pass2(e2fsck_t ctx) if (fs->flags & EXT2_FLAG_RW) { sb->s_feature_ro_compat &= ~EXT2_FEATURE_RO_COMPAT_LARGE_FILE; + fs->flags &= ~EXT2_FLAG_MASTER_SB_ONLY; ext2fs_mark_super_dirty(fs); } } diff --git a/e2fsck/super.c b/e2fsck/super.c index e90e9610..b4ddca20 100644 --- a/e2fsck/super.c +++ b/e2fsck/super.c @@ -682,7 +682,7 @@ void check_super_block(e2fsck_t ctx) fs->super->s_feature_incompat &= ~EXT2_FEATURE_INCOMPAT_FILETYPE; ext2fs_mark_super_dirty(fs); - + fs->flags &= ~EXT2_FLAG_MASTER_SB_ONLY; } } @@ -700,6 +700,7 @@ void check_super_block(e2fsck_t ctx) fix_problem(ctx, PR_0_FS_REV_LEVEL, &pctx)) { ext2fs_update_dynamic_rev(fs); ext2fs_mark_super_dirty(fs); + fs->flags &= ~EXT2_FLAG_MASTER_SB_ONLY; } check_resize_inode(ctx); diff --git a/e2fsck/unix.c b/e2fsck/unix.c index 72545dab..fbfd8e20 100644 --- a/e2fsck/unix.c +++ b/e2fsck/unix.c @@ -1252,6 +1252,7 @@ restart: if (journal_size < 0) { fs->super->s_feature_compat &= ~EXT3_FEATURE_COMPAT_HAS_JOURNAL; + fs->flags &= ~EXT2_FLAG_MASTER_SB_ONLY; com_err(ctx->program_name, 0, _("Couldn't determine journal size")); goto no_journal; |