[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <8f798915e2322756a7c01126865997ee3c77cc78.1667822612.git.ritesh.list@gmail.com>
Date: Mon, 7 Nov 2022 17:51:54 +0530
From: "Ritesh Harjani (IBM)" <ritesh.list@...il.com>
To: Theodore Ts'o <tytso@....edu>
Cc: linux-ext4@...r.kernel.org,
Harshad Shirwadkar <harshadshirwadkar@...il.com>,
Wang Shilong <wshilong@....com>,
Andreas Dilger <adilger.kernel@...ger.ca>,
Li Xi <lixi@....com>, Li Dongyang <dongyangli@....com>,
Maloo <maloo@...mcloud.com>,
Andreas Dilger <adilger@...mcloud.com>,
Ritesh Harjani <ritesh.list@...il.com>
Subject: [RFCv1 66/72] e2fsck: merge casefolded dir lists after thread finish
From: Wang Shilong <wshilong@....com>
This is missed and should be done after threads finish.
Original commit:
18538b27 ("LU-8465 e2fsck: merge encrypted dir lists after thread finish")
Upstream is now using e2fsck_struct->casefolded_dirs instead of
encrypted_dirs.
Only for the correctness of pfsck, we won't use casefolded feature on
ldiskfs.
Signed-off-by: Wang Shilong <wshilong@....com>
Signed-off-by: Li Dongyang <dongyangli@....com>
Tested-by: Maloo <maloo@...mcloud.com>
Reviewed-by: Andreas Dilger <adilger@...mcloud.com>
Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@...il.com>
---
e2fsck/pass1.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c
index 8a6cdd8f..7345c96d 100644
--- a/e2fsck/pass1.c
+++ b/e2fsck/pass1.c
@@ -2614,6 +2614,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;
retval = e2fsck_allocate_block_bitmap(global_ctx->fs,
_("in-use block map"), EXT2FS_BMAP64_RBTREE,
@@ -2905,6 +2906,24 @@ static errcode_t e2fsck_pass1_merge_ea_refcount(e2fsck_t global_ctx,
return retval;
}
+static errcode_t e2fsck_pass1_merge_casefolded_dirs(e2fsck_t global_ctx,
+ e2fsck_t thread_ctx)
+{
+ errcode_t retval = 0;
+
+ if (!thread_ctx->casefolded_dirs)
+ return 0;
+
+ if (!global_ctx->casefolded_dirs)
+ retval = ext2fs_badblocks_copy(thread_ctx->casefolded_dirs,
+ &global_ctx->casefolded_dirs);
+ else
+ retval = ext2fs_badblocks_merge(thread_ctx->casefolded_dirs,
+ global_ctx->casefolded_dirs);
+
+ return retval;
+}
+
static errcode_t e2fsck_pass1_merge_context(e2fsck_t global_ctx,
e2fsck_t thread_ctx)
{
@@ -2971,6 +2990,13 @@ static errcode_t e2fsck_pass1_merge_context(e2fsck_t global_ctx,
if (retval)
return retval;
+ retval = e2fsck_pass1_merge_casefolded_dirs(global_ctx, thread_ctx);
+ if (retval) {
+ com_err(global_ctx->program_name, 0,
+ _("while merging casefolded dirs\n"));
+ return retval;
+ }
+
e2fsck_pass1_merge_invalid_bitmaps(global_ctx, thread_ctx);
retval = e2fsck_pass1_merge_bitmap(global_fs,
--
2.37.3
Powered by blists - more mailing lists