From cb4f0f44147a1fe3fde5b56126dce10b150aa5ba Mon Sep 17 00:00:00 2001 From: Wang Shilong Date: Tue, 25 Aug 2020 16:31:27 +0800 Subject: [PATCH] LU-8465 e2fsck: merge expand_eisize_map properly Min known min_extra_isize should be updated after threads finish. Change-Id: Ia4b00cd9c8064c8829e5c3e9f83d034d100600a5 Signed-off-by: Wang Shilong Reviewed-on: https://review.whamcloud.com/37997 Reviewed-by: Andreas Dilger Tested-by: jenkins Tested-by: Maloo --- e2fsck/pass1.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c index 802d064..f20cf00 100644 --- a/e2fsck/pass1.c +++ b/e2fsck/pass1.c @@ -2839,6 +2839,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->encrypted_dirs = NULL; + thread_context->expand_eisize_map = NULL; retval = e2fsck_allocate_block_bitmap(global_ctx->fs, _("in-use block map"), EXT2FS_BMAP64_RBTREE, @@ -3309,6 +3310,9 @@ static int e2fsck_pass1_thread_join_one(e2fsck_t global_ctx, e2fsck_t thread_ctx global_ctx->invalid_bitmaps = invalid_bitmaps; 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); @@ -3351,6 +3355,12 @@ static int e2fsck_pass1_thread_join_one(e2fsck_t global_ctx, e2fsck_t thread_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; @@ -3392,6 +3402,7 @@ static int e2fsck_pass1_thread_join(e2fsck_t global_ctx, e2fsck_t thread_ctx) e2fsck_pass1_free_bitmap(&thread_ctx->inodes_to_rebuild); e2fsck_pass1_free_bitmap(&thread_ctx->block_found_map); e2fsck_pass1_free_bitmap(&thread_ctx->block_ea_map); + e2fsck_pass1_free_bitmap(&thread_ctx->expand_eisize_map); if (thread_ctx->refcount) ea_refcount_free(thread_ctx->refcount); if (thread_ctx->refcount_extra) -- 1.8.3.1