Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1666130rwb; Mon, 7 Nov 2022 04:31:08 -0800 (PST) X-Google-Smtp-Source: AMsMyM6kLBbVeZA/vNBEPltQ2JVv3wsPusFYSFV1mpVXfaFskX4fSha1JhYAkd16SCN9ZwYtorUn X-Received: by 2002:a17:902:f684:b0:187:1d07:7339 with SMTP id l4-20020a170902f68400b001871d077339mr41235945plg.23.1667824268388; Mon, 07 Nov 2022 04:31:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667824268; cv=none; d=google.com; s=arc-20160816; b=zIhW/CcUbQxurGpn3W8Mz4nQ4Xo3gFcV4nY2exlayP5YxKP3Ek5Y50uDm/tjqnt4dg AUsxDAc/47IWQLtza5JbkzmLzD+JuK43rjUI0ip7b8+GRCCk7jFphrbU+29Hoxbm0+rg RtRgBDMlZABW+EHuHihHdm0lx7rc9HEh0+WgM/Q+FA6xnHi8H2bpwpZMHgZac2MRY4Iz JdlIFKjT1tTknB3qq89Ev7g/VArzWb0dQQZEXrbJEyD9uBJWdFI8YhjY20/xb3fg7ILN yT9KtYnRIkRLB9slCxCQGi5y7/40ww9Bk2oze1I73o0ZTbHIBBezB8RAw5sa+MAbAi1u Su/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2nvBMel3mK2Mvtlci+Tq1QH/JT3NGu7C2JwIvGymT7Q=; b=J/mHnzO/Tf0Xjt3zHVcfQfw01P+eoucbRJzz59Xwg+WQCf6JaJriJpIuVMeGntRTEW 7vykLbCU+IeLfwNwkqgjPZr45kZqKuZfBFAxrWkOrFpxc3EI0zl6sDAeayC3uCafmsQo tR1x9xSUp5jheQNJqG/jtQnf2bFi/zBneQL85V7BsOP6Lr6jga+rI3lxHhZXslHgRxna 3CwtmKQhoNiiMydx5J0pZhsEAaRTK6poiEbYsATLdXzpXUgTSIYI4hOCOk6Oiozav6ga q1j2r8xz2JqmbgBMeVoYRnrPm+vXMk/9/5lU1pE1lIMYCoueFzrSXC6VpvdyHQHfzOr9 Rgeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ePJ+cziZ; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k19-20020aa788d3000000b0056ae8f6df38si10838540pff.180.2022.11.07.04.30.53; Mon, 07 Nov 2022 04:31:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ePJ+cziZ; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232259AbiKGMat (ORCPT + 99 others); Mon, 7 Nov 2022 07:30:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232134AbiKGM3I (ORCPT ); Mon, 7 Nov 2022 07:29:08 -0500 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17E93A186 for ; Mon, 7 Nov 2022 04:29:08 -0800 (PST) Received: by mail-pj1-x1034.google.com with SMTP id q1-20020a17090a750100b002139ec1e999so10148326pjk.1 for ; Mon, 07 Nov 2022 04:29:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2nvBMel3mK2Mvtlci+Tq1QH/JT3NGu7C2JwIvGymT7Q=; b=ePJ+cziZfDJxFxKvbhpzfqF8URTyI6EmFSPGx3+aAJrdEAkraliTEn570uM8cuxJEH taNm/9liXM4MxlZViQS77Yf5b03lcsgcUOc1T0Fj4BwUuc+vAUurrouTAnVFIKsgxAXW JCaM+VqtsBTRBDi6DdOZZDMhQLM39gwWb044FEQ8Rm0dSrRXwzrUBfiw5EhsCG1Ia6VP SuT1kiTz2UP20S49rT6JL6N8cKsqZTWzwhQL5uexcFTCX17SKBU0/BR3STu3/iBtDkkN MaMsDl+XuMBSPMu7lJnEGmJdG+ushXK4kv4oie3E9YO4jS7dNdYNjMuQkAVulpppJM86 B1aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2nvBMel3mK2Mvtlci+Tq1QH/JT3NGu7C2JwIvGymT7Q=; b=HvvL2KYae5ynmPpLX6DsafnCAFUuN6UKO/hHsFXH+9jDN9+CNM3tXrdASDKmEAcnGc YivCV+8lx1wou+2Fp3sorgFgxBRIIkBW4wce65eYHP2cxGNYT0oxnL5PZ4SGupFAMmmB 34bzm8c7dogmlinKeOca0ikn88db6j6tBBcJSkqyCXzKd3TQGU3V4NeRCRABwJjnfYdN y2yLvw+mQIbyAIMgIEtlYQV/uWfKkZfX1XT4jqjRDZT8vwfEeAat/qhPi/9P5ZMRPLDb RIUbsPmbwLbNJkeemDmtAKrLTaKdpxAnvxxP8Dh9ogdMMgrA1AAj5JVknm2FNY84xtSW Nbmw== X-Gm-Message-State: ANoB5pm4y5QHqr2+YDQf7U/FdIemAtc4fb8iioIaleSdEGtfp3zuU/1b cx5V5xirNZcTpK++WtM1HWk= X-Received: by 2002:a17:903:1209:b0:188:8239:8ee3 with SMTP id l9-20020a170903120900b0018882398ee3mr4423144plh.21.1667824147644; Mon, 07 Nov 2022 04:29:07 -0800 (PST) Received: from localhost ([2406:7400:63:f20b:312d:45b2:85c1:c486]) by smtp.gmail.com with ESMTPSA id n7-20020a63f807000000b0046ece12f042sm4047214pgh.15.2022.11.07.04.29.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Nov 2022 04:29:06 -0800 (PST) From: "Ritesh Harjani (IBM)" To: Theodore Ts'o Cc: linux-ext4@vger.kernel.org, Harshad Shirwadkar , Wang Shilong , Andreas Dilger , Li Xi , Li Dongyang , Maloo , Andreas Dilger , Ritesh Harjani Subject: [RFCv1 66/72] e2fsck: merge casefolded dir lists after thread finish Date: Mon, 7 Nov 2022 17:51:54 +0530 Message-Id: <8f798915e2322756a7c01126865997ee3c77cc78.1667822612.git.ritesh.list@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org From: Wang Shilong 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 Signed-off-by: Li Dongyang Tested-by: Maloo Reviewed-by: Andreas Dilger Signed-off-by: Ritesh Harjani (IBM) --- 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