Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp977372pxp; Wed, 16 Mar 2022 23:14:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQFeOA012Y2PpRtJNrLKZ9+oxrZacfH3SfW3ryGHp0kUL7Iz9UxJ43qSJdDfAlRM4N+KEJ X-Received: by 2002:a17:903:204a:b0:153:a38b:977e with SMTP id q10-20020a170903204a00b00153a38b977emr3541071pla.126.1647497674246; Wed, 16 Mar 2022 23:14:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647497674; cv=none; d=google.com; s=arc-20160816; b=RndeONBELERzjN5283feBDGLOSDOZsHoOBx6lqS84VI4iMUKm5ZIsUiKCFY/Lbvy4l ft3sxRY2e//t1rhQk6MJbb3Th0Q1vV8VEvHDnWhjtVdWTDfP8VPLFPELOq38JqJ6Gcxj 90f2nDIUre+di9uu5KLyALpWN/oGYMgAytyGmkACWL2ZPON3ITFsjfnpUFWhN9cEckh5 Pf1qJhfQ/uz6rQFWgWRgV3gwQq2xWZldcyEtxIRB2Z8+QGACPL4bLd1zwgo5m1XiIbNj 3TIDQmUjfTP31ocMBvUuLl9vZHYY1G5bVOIVpNFm0rgTFpKxweH6bhEzRaDucj8/C2Bo kmXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:thread-index:thread-topic :content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date; bh=kKZZRG28+wLisZ/Wefa+xFKNTz2HOh9UFFw4rx/j0Qs=; b=eQrLKcamgSog2jP/UdQo+a5g7ItxVEWlA532WocjQZZC6NoUgTMmE75Pfk0HFLRXZ1 BtMTWq8/hbdqxczTk3dO5dYtTIWIUqv7RNRosH645uERbxePKuvi8+rZANaP3Zcfiu76 GYnuW32AHuMYqkTgw9ax5S+LPD4tio+c0uzMwgiYEr1Nhuh2/zMaPHpdwSvfn8c9XSiD z3jpZj8YITvZ5c1GEhI+s+MygNN2xLL3gh9DeyTLaQd1nLupfY58awPEPKZvopbwN0Ae xPHb9qA7xMNrhpArdXxqEdLlMunEBii25oYM2XvevINXpwNQBmldZpgGwNKBOWP1C6x4 rNUg== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id f186-20020a636ac3000000b00381eddcb6e5si1095035pgc.183.2022.03.16.23.14.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 23:14:34 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CE848D8F73; Wed, 16 Mar 2022 21:57:29 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239158AbiCPWBc convert rfc822-to-8bit (ORCPT + 99 others); Wed, 16 Mar 2022 18:01:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232754AbiCPWBb (ORCPT ); Wed, 16 Mar 2022 18:01:31 -0400 Received: from lithops.sigma-star.at (lithops.sigma-star.at [195.201.40.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78C00C2C for ; Wed, 16 Mar 2022 15:00:15 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id 741E76081104; Wed, 16 Mar 2022 23:00:13 +0100 (CET) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id SdOFjOGIOYjO; Wed, 16 Mar 2022 23:00:12 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id 8F5366081107; Wed, 16 Mar 2022 23:00:12 +0100 (CET) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Z-NKGvmhIHbB; Wed, 16 Mar 2022 23:00:12 +0100 (CET) Received: from lithops.sigma-star.at (lithops.sigma-star.at [195.201.40.130]) by lithops.sigma-star.at (Postfix) with ESMTP id 6C6776081104; Wed, 16 Mar 2022 23:00:12 +0100 (CET) Date: Wed, 16 Mar 2022 23:00:12 +0100 (CET) From: Richard Weinberger To: libaokun Cc: linux-mtd , linux-kernel , yukuai3 , chengzhihao1 Message-ID: <157336576.152785.1647468012272.JavaMail.zimbra@nod.at> In-Reply-To: References: <20220215040736.2839939-1-libaokun1@huawei.com> Subject: Re: [PATCH -next] ubifs: rename_whiteout: correct old_dir size computing MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-Originating-IP: [195.201.40.130] X-Mailer: Zimbra 8.8.12_GA_3807 (ZimbraWebClient - FF97 (Linux)/8.8.12_GA_3809) Thread-Topic: ubifs: rename_whiteout: correct old_dir size computing Thread-Index: qEsEa6jzfGu0qBp13jytxNkZcU+ggw== X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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-kernel@vger.kernel.org ----- Ursprüngliche Mail ----- > Von: "libaokun" > An: "richard" , "linux-mtd" , "linux-kernel" > > CC: "yukuai3" , "chengzhihao1" , "libaokun" > Gesendet: Donnerstag, 10. März 2022 09:32:57 > Betreff: Re: [PATCH -next] ubifs: rename_whiteout: correct old_dir size computing > A gentle ping, sorry for the noise. I have to say sorry for the day. Thanks for your patience with me. > > 在 2022/2/15 12:07, Baokun Li 写道: >> When renaming the whiteout file, the old whiteout file is not deleted. >> Therefore, we add the old dentry size to the old dir like XFS. >> Otherwise, an error may be reported due to `fscki->calc_sz != fscki->size` >> in check_indes. >> >> Fixes: 9e0a1fff8db56ea ("ubifs: Implement RENAME_WHITEOUT") >> Reported-by: Zhihao Cheng >> Signed-off-by: Baokun Li >> --- >> fs/ubifs/dir.c | 3 +++ >> 1 file changed, 3 insertions(+) >> >> diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c >> index ae082a0be2a3..86151889548e 100644 >> --- a/fs/ubifs/dir.c >> +++ b/fs/ubifs/dir.c >> @@ -1402,6 +1402,9 @@ static int do_rename(struct inode *old_dir, struct dentry >> *old_dentry, >> iput(whiteout); >> goto out_release; >> } >> + >> + /* Add the old_dentry size to the old_dir size. */ >> + old_sz -= CALC_DENT_SIZE(fname_len(&old_nm)); So you basically reset old_sz back to 0? Thanks, //richard