Whamcloud - gitweb
LU-14768 e2fsck: merge expand_eisize_map properly
authorWang Shilong <wshilong@ddn.com>
Tue, 25 Aug 2020 08:31:27 +0000 (16:31 +0800)
committerLi Dongyang <dongyangli@ddn.com>
Fri, 28 Apr 2023 00:51:25 +0000 (10:51 +1000)
Min known min_extra_isize should be updated after
threads finish.

Original commit:
cb4f0f44 ("LU-8465 e2fsck: merge expand_eisize_map properly")

Add the missing commit back, in pass5 we won't pick up some of
the inodes marked in pass1 for eisize expanding.

This should be merged to
e47509eb ("e2fsck: add support for expanding the inode size")
in the next rebase.

Change-Id: Ie9703383821ecb11337630d74ffb0c7dcb2fcc1e
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Signed-off-by: Li Dongyang <dongyangli@ddn.com>
Reviewed-on: https://review.whamcloud.com/44011
Reviewed-by: Wang Shilong <wshilong@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
e2fsck/pass1.c

index 0b30e23..b09f2b0 100644 (file)
@@ -2921,6 +2921,7 @@ static errcode_t e2fsck_pass1_thread_prepare(e2fsck_t global_ctx, e2fsck_t *thre
        memcpy(thread_context, global_ctx, sizeof(struct e2fsck_struct));
        thread_context->block_dup_map = NULL;
        thread_context->casefolded_dirs = NULL;
+       thread_context->expand_eisize_map = NULL;
 
        retval = e2fsck_allocate_block_bitmap(global_ctx->fs,
                                _("in-use block map"), EXT2FS_BMAP64_RBTREE,
@@ -3328,6 +3329,9 @@ static errcode_t e2fsck_pass1_merge_context(e2fsck_t global_ctx,
 
        e2fsck_pass1_merge_invalid_bitmaps(global_ctx, thread_ctx);
 
+       if (thread_ctx->min_extra_isize < global_ctx->min_extra_isize)
+               global_ctx->min_extra_isize = thread_ctx->min_extra_isize;
+
        retval = e2fsck_pass1_merge_bitmap(global_fs,
                                &thread_ctx->inode_used_map,
                                &global_ctx->inode_used_map);
@@ -3370,6 +3374,12 @@ static errcode_t e2fsck_pass1_merge_context(e2fsck_t global_ctx,
        if (retval)
                return retval;
 
+       retval = e2fsck_pass1_merge_bitmap(global_fs,
+                               &thread_ctx->expand_eisize_map,
+                               &global_ctx->expand_eisize_map);
+       if (retval)
+               return retval;
+
        if (ext2fs_has_feature_shared_blocks(global_fs->super) &&
            !(global_ctx->options & E2F_OPT_UNSHARE_BLOCKS))
                return 0;