Whamcloud - gitweb
config: update config.{guess,sub}
[tools/e2fsprogs.git] / e2fsck / super.c
index bfd1006..e5932be 100644 (file)
@@ -436,6 +436,14 @@ void check_resize_inode(e2fsck_t ctx)
 
        clear_problem_context(&pctx);
 
+       if (ext2fs_has_feature_resize_inode(fs->super) &&
+           ext2fs_has_feature_meta_bg(fs->super) &&
+           fix_problem(ctx, PR_0_DISABLE_RESIZE_INODE, &pctx)) {
+               ext2fs_clear_feature_resize_inode(fs->super);
+               fs->super->s_reserved_gdt_blocks = 0;
+               ext2fs_mark_super_dirty(fs);
+       }
+
        /*
         * If the resize inode feature isn't set, then
         * s_reserved_gdt_blocks must be zero.
@@ -676,6 +684,12 @@ void check_super_block(e2fsck_t ctx)
                if (fix_problem(ctx, PR_0_INODE_COUNT_WRONG, &pctx)) {
                        sb->s_inodes_count = should_be;
                        ext2fs_mark_super_dirty(fs);
+               } else {
+                       pctx.num = sb->s_inodes_count;
+                       pctx.str = "inodes_count";
+                       fix_problem(ctx, PR_0_MISC_CORRUPT_SUPER, &pctx);
+                       ctx->flags |= E2F_FLAG_ABORT;
+                       return;
                }
        }
        if (sb->s_rev_level > EXT2_GOOD_OLD_REV &&