Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63BF3C636D4 for ; Fri, 17 Feb 2023 07:24:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229644AbjBQHYU (ORCPT ); Fri, 17 Feb 2023 02:24:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229436AbjBQHYO (ORCPT ); Fri, 17 Feb 2023 02:24:14 -0500 Received: from dggsgout12.his.huawei.com (unknown [45.249.212.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9539E5529C; Thu, 16 Feb 2023 23:24:12 -0800 (PST) Received: from mail02.huawei.com (unknown [172.30.67.153]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4PJ3GH2b9qz4f3jHn; Fri, 17 Feb 2023 15:24:07 +0800 (CST) Received: from [10.174.178.129] (unknown [10.174.178.129]) by APP4 (Coremail) with SMTP id gCh0CgAX8bRsKu9jMfUfDw--.45875S2; Fri, 17 Feb 2023 15:19:09 +0800 (CST) Subject: Re: [PATCH 04/21] ext4: get correct ext4_group_info in ext4_mb_prefetch_fini To: "Ritesh Harjani (IBM)" , tytso@mit.edu, adilger.kernel@dilger.ca, jack@suse.cz Cc: linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org References: <87ttzkiybi.fsf@doe.com> From: Kemeng Shi Message-ID: <182b8237-d504-46de-8521-8508449f7b82@huaweicloud.com> Date: Fri, 17 Feb 2023 15:19:07 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: <87ttzkiybi.fsf@doe.com> Content-Type: text/plain; charset=gbk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hVjvjDU0xZFpf9x07UE-erUUUUU= X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org on 2/17/2023 2:46 PM, Ritesh Harjani (IBM) wrote: > Kemeng Shi 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 >> --- >> 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. -- Best wishes Kemeng Shi