Whamcloud - gitweb
e2fsck: merge dblist after thread finishes
[tools/e2fsprogs.git] / e2fsck / super.c
index eb7ab0d..123813b 100644 (file)
@@ -281,7 +281,8 @@ static errcode_t e2fsck_read_all_quotas(e2fsck_t ctx)
                if (qf_ino == 0)
                        continue;
 
-               retval = quota_update_limits(ctx->qctx, qf_ino, qtype);
+               retval = quota_read_all_dquots(ctx->qctx, qf_ino, qtype,
+                                              QREAD_USAGE | QREAD_LIMITS);
                if (retval)
                        break;
        }
@@ -436,6 +437,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.
@@ -587,7 +596,7 @@ void check_super_block(e2fsck_t ctx)
        blk64_t should_be;
        struct problem_context  pctx;
        blk64_t free_blocks = 0;
-       ino_t   free_inodes = 0;
+       ext2_ino_t free_inodes = 0;
        int     csum_flag, clear_test_fs_flag;
 
        inodes_per_block = EXT2_INODES_PER_BLOCK(fs->super);
@@ -1030,9 +1039,9 @@ void check_super_block(e2fsck_t ctx)
         * Check to see if the superblock last mount time or last
         * write time is in the future.
         */
-       if (!broken_system_clock &&
-           !(ctx->flags & E2F_FLAG_TIME_INSANE) &&
-           fs->super->s_mtime > (__u32) ctx->now) {
+       if (((ctx->options & E2F_OPT_FORCE) || fs->super->s_checkinterval) &&
+           !broken_system_clock && !(ctx->flags & E2F_FLAG_TIME_INSANE) &&
+           (fs->super->s_mtime > (__u32) ctx->now)) {
                pctx.num = fs->super->s_mtime;
                problem = PR_0_FUTURE_SB_LAST_MOUNT;
                if (fs->super->s_mtime <= (__u32) ctx->now + ctx->time_fudge)
@@ -1042,9 +1051,9 @@ void check_super_block(e2fsck_t ctx)
                        fs->flags |= EXT2_FLAG_DIRTY;
                }
        }
-       if (!broken_system_clock &&
-           !(ctx->flags & E2F_FLAG_TIME_INSANE) &&
-           fs->super->s_wtime > (__u32) ctx->now) {
+       if (((ctx->options & E2F_OPT_FORCE) || fs->super->s_checkinterval) &&
+           !broken_system_clock && !(ctx->flags & E2F_FLAG_TIME_INSANE) &&
+           (fs->super->s_wtime > (__u32) ctx->now)) {
                pctx.num = fs->super->s_wtime;
                problem = PR_0_FUTURE_SB_LAST_WRITE;
                if (fs->super->s_wtime <= (__u32) ctx->now + ctx->time_fudge)