Whamcloud - gitweb
ChangeLog, pass1.c:
authorTheodore Ts'o <tytso@mit.edu>
Wed, 19 Nov 1997 21:39:13 +0000 (21:39 +0000)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 19 Nov 1997 21:39:13 +0000 (21:39 +0000)
  Fix bug where first_block wasn't getting incremented, which caused
  user to get a "Programming error?" warning if there was a bad block in
  a non-primary superblock/group_descriptor.  Also fixed another bug so
  that ext2fs_bg_has_super() is consulted, to avoid problems when using
  a filesystem with the sparse_groups option set and there are bad
  blocks at the beginning of a group which doesn't have a superblock.

e2fsck/ChangeLog
e2fsck/pass1.c

index c5942c7..834eb4e 100644 (file)
@@ -1,3 +1,14 @@
+Wed Nov 19 16:15:44 1997  Theodore Ts'o  <tytso@rsts-11.mit.edu>
+
+       * pass1.c (process_bad_block): Fix bug where first_block wasn't
+               getting incremented, which caused user to get a
+               "Programming error?" warning if there was a bad block in a
+               non-primary superblock/group_descriptor.  Also fixed
+               another bug so that ext2fs_bg_has_super() is consulted, to
+               avoid problems when using a filesystem with the
+               sparse_groups option set and there are bad blocks at the
+               beginning of a group which doesn't have a superblock.
+
 Thu Nov  6 16:10:20 1997  Theodore Ts'o  <tytso@rsts-11.mit.edu>
 
        * pass1.c, pass2.c, pass3.c, pass4.c, pass5.c: Add calls to the 
index c973fdb..f2e0e6c 100644 (file)
@@ -961,6 +961,8 @@ int process_bad_block(ext2_filsys fs,
        for (i = 0; i < fs->group_desc_count; i++ ) {
                pctx->group = i;
                pctx->blk = blk;
+               if (!ext2fs_bg_has_super(fs, i))
+                       goto skip_super;
                if (blk == first_block) {
                        if (i == 0) {
                                if (fix_problem(ctx,
@@ -988,6 +990,7 @@ int process_bad_block(ext2_filsys fs,
                        fix_problem(ctx, PR_1_BAD_GROUP_DESCRIPTORS, pctx);
                        return 0;
                }
+       skip_super:
                if (blk == fs->group_desc[i].bg_block_bitmap) {
                        if (fix_problem(ctx, PR_1_BB_BAD_BLOCK, pctx)) {
                                ctx->invalid_block_bitmap_flag[i]++;
@@ -1012,6 +1015,7 @@ int process_bad_block(ext2_filsys fs,
                         */
                        return 0;
                }
+               first_block += fs->super->s_blocks_per_group;
        }
        /*
         * If we've gotten to this point, then the only