OSDN Git Service

Change e2fsck to force out changes to the backup copies of the
authorTheodore Ts'o <tytso@mit.edu>
Fri, 8 Nov 2002 16:10:28 +0000 (11:10 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 8 Nov 2002 16:10:28 +0000 (11:10 -0500)
superblock and block group descriptors when important changes
are made to those data structures.

e2fsck/ChangeLog
e2fsck/pass1.c
e2fsck/super.c
e2fsck/swapfs.c

index b50b25f..8e32eeb 100644 (file)
@@ -1,3 +1,13 @@
+2002-11-08    <tytso@snap.thunk.org>
+
+       * 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  <tytso@mit.edu>
 
        * e2fsck.h, unix.c (main, check_mount): Fix e2fsck so that it
index 52cdb04..f7ee111 100644 (file)
@@ -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);
index a8ea779..2deff44 100644 (file)
@@ -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
index b59079c..de71369 100644 (file)
@@ -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)