From: Theodore Ts'o Date: Fri, 8 Nov 2002 16:10:28 +0000 (-0500) Subject: Change e2fsck to force out changes to the backup copies of the X-Git-Tag: E2FSPROGS-1_31~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=299d742427776629ef07b4563f41a4e00fc23aa0;p=thirdparty%2Fe2fsprogs.git Change e2fsck to force out changes to the backup copies of the superblock and block group descriptors when important changes are made to those data structures. --- diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog index b50b25fc7..8e32eeb3a 100644 --- a/e2fsck/ChangeLog +++ b/e2fsck/ChangeLog @@ -1,3 +1,13 @@ +2002-11-08 + + * pass1.c (new_table_block), super.c (check_super_block), swapfs.c + (swap_filesys): Clear EXT2_FLAG_MASTER_SB_ONLY to make + sure the backup superblocks and group descriptors are + updated when we make an important change to the + superblocks and/or group descriptors. (i.e., generating a + UUID, allocating filesystem metadata, or byte-swapping the + filesystem.) + 2002-11-07 Theodore Ts'o * e2fsck.h, unix.c (main, check_mount): Fix e2fsck so that it diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c index 52cdb04c2..f7ee11178 100644 --- a/e2fsck/pass1.c +++ b/e2fsck/pass1.c @@ -1732,6 +1732,7 @@ static void new_table_block(e2fsck_t ctx, blk_t first_block, int group, return; } ext2fs_mark_super_dirty(fs); + fs->flags &= ~EXT2_FLAG_MASTER_SB_ONLY; pctx.blk2 = *new_block; fix_problem(ctx, (old_block ? PR_1_RELOC_FROM_TO : PR_1_RELOC_TO), &pctx); diff --git a/e2fsck/super.c b/e2fsck/super.c index a8ea779db..2deff4469 100644 --- a/e2fsck/super.c +++ b/e2fsck/super.c @@ -484,6 +484,7 @@ void check_super_block(e2fsck_t ctx) if (fix_problem(ctx, PR_0_ADD_UUID, &pctx)) { uuid_generate(sb->s_uuid); ext2fs_mark_super_dirty(fs); + fs->flags &= ~EXT2_FLAG_MASTER_SB_ONLY; } } #endif diff --git a/e2fsck/swapfs.c b/e2fsck/swapfs.c index b59079c40..de71369f0 100644 --- a/e2fsck/swapfs.c +++ b/e2fsck/swapfs.c @@ -254,7 +254,9 @@ void swap_filesys(e2fsck_t ctx) ext2fs_swap_bitmap(fs->block_map); fs->flags |= EXT2_FLAG_BB_DIRTY | EXT2_FLAG_IB_DIRTY; #endif + fs->flags &= ~EXT2_FLAG_MASTER_SB_ONLY; ext2fs_flush(fs); + fs->flags |= EXT2_FLAG_MASTER_SB_ONLY; #ifdef RESOURCE_TRACK if (ctx->options & E2F_OPT_TIME2)