summaryrefslogtreecommitdiff
path: root/e2fsck/pass1.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>1997-11-19 21:39:13 +0000
committerTheodore Ts'o <tytso@mit.edu>1997-11-19 21:39:13 +0000
commit8039c4802ff1ac433026202de19c4d141214de40 (patch)
tree76ad51e4024dcbd7656eaa5407917de8bbf8351f /e2fsck/pass1.c
parentf8188fff23dc2d9c9f858fb21264e46b17672825 (diff)
downloade2fsprogs-8039c4802ff1ac433026202de19c4d141214de40.tar.gz
ChangeLog, pass1.c:
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.
Diffstat (limited to 'e2fsck/pass1.c')
-rw-r--r--e2fsck/pass1.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c
index c973fdbb..f2e0e6c0 100644
--- a/e2fsck/pass1.c
+++ b/e2fsck/pass1.c
@@ -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