Message ID | 20230209194825.511043-5-shikemeng@huaweicloud.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp289104wrn; Thu, 9 Feb 2023 03:58:27 -0800 (PST) X-Google-Smtp-Source: AK7set8a594bf1R4+n1Dd3d8aSfkFUro3ajNk/ALjbgowt3Y7y785jZf0r/VLHUShQhe8mL0iI9v X-Received: by 2002:a05:6a21:6716:b0:bc:97d7:3cbb with SMTP id wh22-20020a056a21671600b000bc97d73cbbmr8360616pzb.15.1675943907345; Thu, 09 Feb 2023 03:58:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675943907; cv=none; d=google.com; s=arc-20160816; b=XMllVXIh2fj1a5HD0kHj3EPY/omX0f3Jj/XXhA0QVWraKGEji+0VO6DQIcyBq3ZI5l GSzpzZQ7HpUNtmjC9GbJcuRQSyPrGR2bLolCFanavFWYHlZcsYQ91BUl+MiLOOg/lpMs VaLXrswjwpU+PTu0BkFNw5dPPwR93pC22bCNK6JHrVoynQjvtWJvKQ8R/gqPdl5jwDod EbUXKSxQDHADthYpMJaK4a5+M+cdMwaw1sojMfHeEXrPTNWQ+3TqiHYSdhzuun5XEBX8 SnsbCCzWwQSQniRXAycILbKpvwex7pVQ7POztRIrB9B9MpnL5ang9yvm5U+EKD7jtf3/ FyFw== 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; bh=0kI/iXwFU4vaWjcGn85CBndUXv5z6bkbvJyloapeG6s=; b=eomArYA41qt7qLWRjRoxmFOglk5q0w6JTYTFEMq05Jer961B0U4fKW8jFUWr8EQdo8 k+NgsMXtHd6b0h0Xd3y66RwHSjJHuFWhTvgIdTaFYELHmwC2UKJlM5WZ/KT7M5gT09+V rPbDFBt2/pdJEoG5ryqSfe6GvGjckpzToF5ru87s3dxlFgdH3ry4yxFpkBfsbx2cJ60i vUoAHHdcdDHwc3ArwygCakohJNVTVeu1FP6eYoh0dMWgSHsmI3VFit5NkT8Ci67Urujc x7JjuhfUHFOMxOWMKGAKArefZwJozYV4CnyAqTyeZKzE7bO68SNrcxAYIIntk+mWtTNR qpSQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u123-20020a637981000000b004e8529ae3eesi1827848pgc.294.2023.02.09.03.58.13; Thu, 09 Feb 2023 03:58:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229831AbjBIL5J (ORCPT <rfc822;ybw1215001957@gmail.com> + 99 others); Thu, 9 Feb 2023 06:57:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229519AbjBIL4L (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 9 Feb 2023 06:56:11 -0500 Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DAAB5C482; Thu, 9 Feb 2023 03:46:29 -0800 (PST) Received: from mail02.huawei.com (unknown [172.30.67.169]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4PCFSc6TkGz4f3jLm; Thu, 9 Feb 2023 19:46:24 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP4 (Coremail) with SMTP id gCh0CgAn3rEQ3eRjgb0tDQ--.53508S6; Thu, 09 Feb 2023 19:46:26 +0800 (CST) From: Kemeng Shi <shikemeng@huaweicloud.com> To: tytso@mit.edu, adilger.kernel@dilger.ca, jack@suse.cz Cc: linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 04/21] ext4: get correct ext4_group_info in ext4_mb_prefetch_fini Date: Fri, 10 Feb 2023 03:48:08 +0800 Message-Id: <20230209194825.511043-5-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20230209194825.511043-1-shikemeng@huaweicloud.com> References: <20230209194825.511043-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: gCh0CgAn3rEQ3eRjgb0tDQ--.53508S6 X-Coremail-Antispam: 1UD129KBjvdXoW7Jr15AF4Dtw4rtw13uFW8Xrb_yoWDtFc_ta 4xAr1fGryrJw1xKr4Sgrn0ya1UtFs5Jr1UXFWftr1fuF4UJw45ZFykAr47Ar17ua93tFZx tr9xJFyxJFn2gjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbS8YFVCjjxCrM7AC8VAFwI0_Wr0E3s1l1xkIjI8I6I8E6xAIw20E Y4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l87I20VAvwVAaII0Ic2I_JFv_Gryl82 xGYIkIc2x26280x7IE14v26r126s0DM28IrcIa0xkI8VCY1x0267AKxVW8JVW5JwA2ocxC 64kIII0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20xvE14v26w1j6s0DM2 8EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4UJVWxJr1l84ACjcxK6I8E87Iv67AKxVW0oVCq 3wA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_GcCE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8w Aqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE 14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCF04k20xvY0x 0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E 7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIxkGc2Ij64vIr41lIxAIcV C0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcVCF 04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7 CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x07jyYLPUUUUU= X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, SPF_HELO_NONE,SPF_NONE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757354558363287407?= X-GMAIL-MSGID: =?utf-8?q?1757354558363287407?= |
Series |
Some bugfix and cleanup to mballoc
|
|
Commit Message
Kemeng Shi
Feb. 9, 2023, 7:48 p.m. UTC
We always get ext4_group_desc with group + 1 and ext4_group_info with
group to check if we need do initialize ext4_group_info for the group.
Just get ext4_group_desc with group for ext4_group_info initialization
check.
Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
---
fs/ext4/mballoc.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
Comments
On Fri, Feb 10, 2023 at 03:48:08AM +0800, Kemeng Shi wrote: > We always get ext4_group_desc with group + 1 and ext4_group_info with > group to check if we need do initialize ext4_group_info for the group. > Just get ext4_group_desc with group for ext4_group_info initialization > check. > > Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com> > --- > fs/ext4/mballoc.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c > index 352ac9139fee..f24f80ecf318 100644 > --- a/fs/ext4/mballoc.c > +++ b/fs/ext4/mballoc.c > @@ -2570,13 +2570,13 @@ void ext4_mb_prefetch_fini(struct super_block *sb, ext4_group_t group, > unsigned int nr) > { > while (nr-- > 0) { > - struct ext4_group_desc *gdp = ext4_get_group_desc(sb, group, > - NULL); > - struct ext4_group_info *grp = ext4_get_group_info(sb, group); > + struct ext4_group_desc *gdp; > + struct ext4_group_info *grp; > > if (!group) > group = ext4_get_groups_count(sb); > group--; > + gdp = ext4_get_group_desc(sb, group, NULL); > grp = ext4_get_group_info(sb, group); > > if (EXT4_MB_GRP_NEED_INIT(grp) && > -- > 2.30.0 > This is a duplicate of [1] :) But I'm okay with this going in as that patchseries might take some time to get merged. Feel free to add: Reviewed-by: Ojaswin Mujoo <ojaswin@linux.ibm.com> [1] https://lore.kernel.org/r/85bbcb3774e38de65b737ef0000241ddbdda73aa.1674822311.git.ojaswin@linux.ibm.com
on 2/13/2023 3:03 PM, Ojaswin Mujoo wrote: > On Fri, Feb 10, 2023 at 03:48:08AM +0800, Kemeng Shi wrote: >> We always get ext4_group_desc with group + 1 and ext4_group_info with >> group to check if we need do initialize ext4_group_info for the group. >> Just get ext4_group_desc with group for ext4_group_info initialization >> check. >> >> Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com> >> --- >> fs/ext4/mballoc.c | 6 +++--- >> 1 file changed, 3 insertions(+), 3 deletions(-) >> >> diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c >> index 352ac9139fee..f24f80ecf318 100644 >> --- a/fs/ext4/mballoc.c >> +++ b/fs/ext4/mballoc.c >> @@ -2570,13 +2570,13 @@ void ext4_mb_prefetch_fini(struct super_block *sb, ext4_group_t group, >> unsigned int nr) >> { >> while (nr-- > 0) { >> - struct ext4_group_desc *gdp = ext4_get_group_desc(sb, group, >> - NULL); >> - struct ext4_group_info *grp = ext4_get_group_info(sb, group); >> + struct ext4_group_desc *gdp; >> + struct ext4_group_info *grp; >> >> if (!group) >> group = ext4_get_groups_count(sb); >> group--; >> + gdp = ext4_get_group_desc(sb, group, NULL); >> grp = ext4_get_group_info(sb, group); >> >> if (EXT4_MB_GRP_NEED_INIT(grp) && >> -- >> 2.30.0 >> > > This is a duplicate of [1] :) > > But I'm okay with this going in as that patchseries might take some time > to get merged. Feel free to add: > > Reviewed-by: Ojaswin Mujoo <ojaswin@linux.ibm.com> > > [1] https://lore.kernel.org/r/85bbcb3774e38de65b737ef0000241ddbdda73aa.1674822311.git.ojaswin@linux.ibm.com > Hi Ojaswin, Thank you so much to review my code. I 'm sorry that I didn't notice this patch is duplicated and I really appreciate that you allow this one to get merged first. I will add your sign to this patch in next version. Thanks!
On Mon, Feb 13, 2023 at 08:27:32PM +0800, Kemeng Shi wrote: > > > on 2/13/2023 3:03 PM, Ojaswin Mujoo wrote: > > On Fri, Feb 10, 2023 at 03:48:08AM +0800, Kemeng Shi wrote: > >> We always get ext4_group_desc with group + 1 and ext4_group_info with > >> group to check if we need do initialize ext4_group_info for the group. > >> Just get ext4_group_desc with group for ext4_group_info initialization > >> check. > >> > >> Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com> > >> --- > >> fs/ext4/mballoc.c | 6 +++--- > >> 1 file changed, 3 insertions(+), 3 deletions(-) > >> > >> diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c > >> index 352ac9139fee..f24f80ecf318 100644 > >> --- a/fs/ext4/mballoc.c > >> +++ b/fs/ext4/mballoc.c > >> @@ -2570,13 +2570,13 @@ void ext4_mb_prefetch_fini(struct super_block *sb, ext4_group_t group, > >> unsigned int nr) > >> { > >> while (nr-- > 0) { > >> - struct ext4_group_desc *gdp = ext4_get_group_desc(sb, group, > >> - NULL); > >> - struct ext4_group_info *grp = ext4_get_group_info(sb, group); > >> + struct ext4_group_desc *gdp; > >> + struct ext4_group_info *grp; > >> > >> if (!group) > >> group = ext4_get_groups_count(sb); > >> group--; > >> + gdp = ext4_get_group_desc(sb, group, NULL); > >> grp = ext4_get_group_info(sb, group); > >> > >> if (EXT4_MB_GRP_NEED_INIT(grp) && > >> -- > >> 2.30.0 > >> > > > > This is a duplicate of [1] :) > > > > But I'm okay with this going in as that patchseries might take some time > > to get merged. Feel free to add: > > > > Reviewed-by: Ojaswin Mujoo <ojaswin@linux.ibm.com> > > > > [1] https://lore.kernel.org/r/85bbcb3774e38de65b737ef0000241ddbdda73aa.1674822311.git.ojaswin@linux.ibm.com > > > Hi Ojaswin, Thank you so much to review my code. I 'm sorry that I didn't > notice this patch is duplicated and I really appreciate that you allow this > one to get merged first. I will add your sign to this patch in next version. > Thanks! Hi Kemeng, So I'm not sure what the norm is when dealing with such duplicate patches, but if you do plan to add the Signed-off-by then I'd just like to point out that the patch I linked is mainly from Ritesh Harjani, so you can pick his Signed-off-by rather than mine. Thanks, ojaswin > > -- > Best wishes > Kemeng Shi >
on 2/14/2023 4:14 AM, Ojaswin Mujoo wrote: > On Mon, Feb 13, 2023 at 08:27:32PM +0800, Kemeng Shi wrote: >> >> >> on 2/13/2023 3:03 PM, Ojaswin Mujoo wrote: >>> On Fri, Feb 10, 2023 at 03:48:08AM +0800, Kemeng Shi wrote: >>>> We always get ext4_group_desc with group + 1 and ext4_group_info with >>>> group to check if we need do initialize ext4_group_info for the group. >>>> Just get ext4_group_desc with group for ext4_group_info initialization >>>> check. >>>> >>>> Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com> >>>> --- >>>> fs/ext4/mballoc.c | 6 +++--- >>>> 1 file changed, 3 insertions(+), 3 deletions(-) >>>> >>>> diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c >>>> index 352ac9139fee..f24f80ecf318 100644 >>>> --- a/fs/ext4/mballoc.c >>>> +++ b/fs/ext4/mballoc.c >>>> @@ -2570,13 +2570,13 @@ void ext4_mb_prefetch_fini(struct super_block *sb, ext4_group_t group, >>>> unsigned int nr) >>>> { >>>> while (nr-- > 0) { >>>> - struct ext4_group_desc *gdp = ext4_get_group_desc(sb, group, >>>> - NULL); >>>> - struct ext4_group_info *grp = ext4_get_group_info(sb, group); >>>> + struct ext4_group_desc *gdp; >>>> + struct ext4_group_info *grp; >>>> >>>> if (!group) >>>> group = ext4_get_groups_count(sb); >>>> group--; >>>> + gdp = ext4_get_group_desc(sb, group, NULL); >>>> grp = ext4_get_group_info(sb, group); >>>> >>>> if (EXT4_MB_GRP_NEED_INIT(grp) && >>>> -- >>>> 2.30.0 >>>> >>> >>> This is a duplicate of [1] :) >>> >>> But I'm okay with this going in as that patchseries might take some time >>> to get merged. Feel free to add: >>> >>> Reviewed-by: Ojaswin Mujoo <ojaswin@linux.ibm.com> >>> >>> [1] https://lore.kernel.org/r/85bbcb3774e38de65b737ef0000241ddbdda73aa.1674822311.git.ojaswin@linux.ibm.com >>> >> Hi Ojaswin, Thank you so much to review my code. I 'm sorry that I didn't >> notice this patch is duplicated and I really appreciate that you allow this >> one to get merged first. I will add your sign to this patch in next version. >> Thanks! > Hi Kemeng, > > So I'm not sure what the norm is when dealing with such duplicate > patches, but if you do plan to add the Signed-off-by then I'd just like > to point out that the patch I linked is mainly from Ritesh Harjani, so > you can pick his Signed-off-by rather than mine. > Sorry that I miss that there are two Signed-off-bys in patch you have already sent. I will collect both signs to this patch. Thanks!
Kemeng Shi <shikemeng@huaweicloud.com> writes: > We always get ext4_group_desc with group + 1 and ext4_group_info with > group to check if we need do initialize ext4_group_info for the group. > Just get ext4_group_desc with group for ext4_group_info initialization > check. > > Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com> > --- > fs/ext4/mballoc.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c > index 352ac9139fee..f24f80ecf318 100644 > --- a/fs/ext4/mballoc.c > +++ b/fs/ext4/mballoc.c > @@ -2570,13 +2570,13 @@ void ext4_mb_prefetch_fini(struct super_block *sb, ext4_group_t group, > unsigned int nr) > { > while (nr-- > 0) { > - struct ext4_group_desc *gdp = ext4_get_group_desc(sb, group, > - NULL); > - struct ext4_group_info *grp = ext4_get_group_info(sb, group); > + struct ext4_group_desc *gdp; > + struct ext4_group_info *grp; We can even declare these variables at the begining of the function like in [1]. Also I would advise to rearrange any "fixes" patches at the begining of the patch series and "cleanup" patches at the end. e.g. this looks like a fix to me. That way it is sometimes easier for people to cherry-pick any fixes if required in their older kernel trees. ;) [1]: https://lore.kernel.org/all/85bbcb3774e38de65b737ef0000241ddbdda73aa.1674822311.git.ojaswin@linux.ibm.com/ -ritesh > > if (!group) > group = ext4_get_groups_count(sb); > group--; > + gdp = ext4_get_group_desc(sb, group, NULL); > grp = ext4_get_group_info(sb, group); > > if (EXT4_MB_GRP_NEED_INIT(grp) && > -- > 2.30.0
on 2/17/2023 2:46 PM, Ritesh Harjani (IBM) wrote: > Kemeng Shi <shikemeng@huaweicloud.com> writes: > >> We always get ext4_group_desc with group + 1 and ext4_group_info with >> group to check if we need do initialize ext4_group_info for the group. >> Just get ext4_group_desc with group for ext4_group_info initialization >> check. >> >> Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com> >> --- >> fs/ext4/mballoc.c | 6 +++--- >> 1 file changed, 3 insertions(+), 3 deletions(-) >> >> diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c >> index 352ac9139fee..f24f80ecf318 100644 >> --- a/fs/ext4/mballoc.c >> +++ b/fs/ext4/mballoc.c >> @@ -2570,13 +2570,13 @@ void ext4_mb_prefetch_fini(struct super_block *sb, ext4_group_t group, >> unsigned int nr) >> { >> while (nr-- > 0) { >> - struct ext4_group_desc *gdp = ext4_get_group_desc(sb, group, >> - NULL); >> - struct ext4_group_info *grp = ext4_get_group_info(sb, group); >> + struct ext4_group_desc *gdp; >> + struct ext4_group_info *grp; > > We can even declare these variables at the begining of the function like > in [1]. Also I would advise to rearrange any "fixes" patches at the > begining of the patch series and "cleanup" patches at the end. > e.g. this looks like a fix to me. > > That way it is sometimes easier for people to cherry-pick any fixes if > required in their older kernel trees. ;) > Hi Ritesh, Thanks for feedback. I declare these variables at the begining of the function in next version. I agree that we should keep bugfix patches at the beginning. Actually, patch 1-8 are all fix patches from my view. So I think current patch sort is fine. Thanks.
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 352ac9139fee..f24f80ecf318 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -2570,13 +2570,13 @@ void ext4_mb_prefetch_fini(struct super_block *sb, ext4_group_t group, unsigned int nr) { while (nr-- > 0) { - struct ext4_group_desc *gdp = ext4_get_group_desc(sb, group, - NULL); - struct ext4_group_info *grp = ext4_get_group_info(sb, group); + struct ext4_group_desc *gdp; + struct ext4_group_info *grp; if (!group) group = ext4_get_groups_count(sb); group--; + gdp = ext4_get_group_desc(sb, group, NULL); grp = ext4_get_group_info(sb, group); if (EXT4_MB_GRP_NEED_INIT(grp) &&