From 91d3d1b9d877ed11958c4933e5cbb9ab48112347 Mon Sep 17 00:00:00 2001 From: Wang Shilong Date: Tue, 25 Aug 2020 16:31:27 +0800 Subject: [PATCH] LU-14768 e2fsck: merge expand_eisize_map properly 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 Signed-off-by: Li Dongyang Reviewed-on: https://review.whamcloud.com/44011 Reviewed-by: Wang Shilong Tested-by: Maloo Reviewed-by: Andreas Dilger Tested-by: jenkins --- e2fsck/pass1.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c index 0b30e23..b09f2b0 100644 --- a/e2fsck/pass1.c +++ b/e2fsck/pass1.c @@ -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; -- 1.8.3.1