Message ID | 20230321161220.418652-5-shikemeng@huaweicloud.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp1649748wrt; Tue, 21 Mar 2023 01:11:27 -0700 (PDT) X-Google-Smtp-Source: AK7set+zwc8Y1UQwvFmgru1Wib8e42IPNMb6xD+7fkwTIKgh3a1sqny0INN5HZx5phU0rLeLsa5z X-Received: by 2002:a17:903:2288:b0:19e:d60a:e9e with SMTP id b8-20020a170903228800b0019ed60a0e9emr1726278plh.42.1679386286948; Tue, 21 Mar 2023 01:11:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679386286; cv=none; d=google.com; s=arc-20160816; b=LOPp/nprWxbTRVWLnFxfCZF7wvxYZ2Fr7BvveduxHawvksVTRwRIg5lBBgL2LIWOi3 wtovb+I3DgTKqKei73m2NFNFp8J/4gdPGj8z04/Ihkiwdxu+oS5U98sAECvHqO3+wgcf v6/aaPSZVSkt9fBo80jo5mW+WT4RjNpM6YQLkNlle6S+kBVYfat04+WqvcppjLtdqms2 OSVsqH/0CWqYAI6J2t6r4+1ztXKmBzNfkBsHoEAgdKO7lo0g3zhuf/XsSRrb2LAJrgC0 htamXAnBum+PsFftCc3Wp8iobHetS0JtFC3ZsmYdEKMTZMS4OiD1+c/m+2rU3Qis9YHx kuDQ== 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=oD2a61kyQpTiaDtz74ir4UXZu/o68SapyCAIyWivtpg=; b=uYvhnB3wZmk7Xh72deaFly/SolB1RdsIPLVJE6DucD/npkzZoaQ9mTtPN764+if1qz Rr+H1WULzDfC+rOT8D1IBEB1qIrouXQrnlPkjm28YuQQd3dZP6pyCVqincnppuGtaKhm PhQZQIvpPvO2ma1BkMxsAmsxm9npV2/Kw1G3WoIpx9UFCgDrgaLLBvwyFD+R5ZDToX6v VA2JIoYHYa3eRLWCaJsfNJvPW5HnY0Z8GZkVnnVOcG+9rx6NaGfx05nptzyP4KiNz4o9 AtfMWXYIieFFKwKIHsvMY5OmAaMG9cmm/M6LwdWJNecvJrkX8NAME7HjQjMDxiDYQcxg BCHw== 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 i5-20020a17090332c500b001a05f8ed0cbsi14592167plr.589.2023.03.21.01.11.12; Tue, 21 Mar 2023 01:11:26 -0700 (PDT) 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 S230492AbjCUIJp (ORCPT <rfc822;pusanteemu@gmail.com> + 99 others); Tue, 21 Mar 2023 04:09:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229924AbjCUIJc (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 21 Mar 2023 04:09:32 -0400 Received: from dggsgout12.his.huawei.com (dggsgout12.his.huawei.com [45.249.212.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FBF42055A; Tue, 21 Mar 2023 01:09:28 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4Pgklm0tWhz4f3jMs; Tue, 21 Mar 2023 16:09:24 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP4 (Coremail) with SMTP id gCh0CgDnnbEzZhlk+NQhFw--.4478S6; Tue, 21 Mar 2023 16:09:25 +0800 (CST) From: Kemeng Shi <shikemeng@huaweicloud.com> To: tytso@mit.edu, adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Cc: ojaswin@linux.ibm.com, shikemeng@huaweicloud.com Subject: [PATCH 4/8] ext4: fix wrong unit use in ext4_mb_find_by_goal Date: Wed, 22 Mar 2023 00:12:16 +0800 Message-Id: <20230321161220.418652-5-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20230321161220.418652-1-shikemeng@huaweicloud.com> References: <20230321161220.418652-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: gCh0CgDnnbEzZhlk+NQhFw--.4478S6 X-Coremail-Antispam: 1UD129KBjvdXoWrZFW5uw48CF15CF1rAr1UKFg_yoWfArg_Ga 1DArWkGFWftwn5C3WFyw4rtFnaga18Jr12gFWrtr15XF1DWr40k3Wqyr43Zrs7Wa1jqa9x Krn8Xry8GF1F9jkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbDkFF20E14v26rWj6s0DM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M280x2IEY4vEnII2IxkI6r1a6r45M28IrcIa0xkI8V A2jI8067AKxVWUAVCq3wA2048vs2IY020Ec7CjxVAFwI0_Xr0E3s1l8cAvFVAK0II2c7xJ M28CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW7JVWDJwA2z4x0Y4vE2I x0cI8IcVCY1x0267AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK 6I8E87Iv6xkF7I0E14v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4 xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8 JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20V AGYxC7MxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAF wI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc4 0Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AK xVW8JVWxJwCI42IY6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr 1lIxAIcVC2z280aVCY1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7sRiVbyDUU UUU== 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_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: <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?1760964155342745160?= X-GMAIL-MSGID: =?utf-8?q?1760964155342745160?= |
Series |
Some fixes and cleanup to mballoc
|
|
Commit Message
Kemeng Shi
March 21, 2023, 4:12 p.m. UTC
We need start in block unit while fe_start is in cluster unit. Use
ext4_grp_offs_to_block helper to convert fe_start to get start in
block unit.
Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
---
fs/ext4/mballoc.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
Comments
On Wed, Mar 22, 2023 at 12:12:16AM +0800, Kemeng Shi wrote: > We need start in block unit while fe_start is in cluster unit. Use > ext4_grp_offs_to_block helper to convert fe_start to get start in > block unit. > > Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com> Feel free to add: Reviewed-by: Ojaswin Mujoo <ojaswin@linux.ibm.com> Regards, ojaswin > --- > fs/ext4/mballoc.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c > index 86d978e1f7dc..9a40e165e7d2 100644 > --- a/fs/ext4/mballoc.c > +++ b/fs/ext4/mballoc.c > @@ -2181,8 +2181,7 @@ int ext4_mb_find_by_goal(struct ext4_allocation_context *ac, > if (max >= ac->ac_g_ex.fe_len && ac->ac_g_ex.fe_len == sbi->s_stripe) { > ext4_fsblk_t start; > > - start = ext4_group_first_block_no(ac->ac_sb, e4b->bd_group) + > - ex.fe_start; > + start = ext4_grp_offs_to_block(ac->ac_sb, &ex); > /* use do_div to get remainder (would be 64-bit modulo) */ > if (do_div(start, sbi->s_stripe) == 0) { > ac->ac_found++; > -- > 2.30.0 >
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 86d978e1f7dc..9a40e165e7d2 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -2181,8 +2181,7 @@ int ext4_mb_find_by_goal(struct ext4_allocation_context *ac, if (max >= ac->ac_g_ex.fe_len && ac->ac_g_ex.fe_len == sbi->s_stripe) { ext4_fsblk_t start; - start = ext4_group_first_block_no(ac->ac_sb, e4b->bd_group) + - ex.fe_start; + start = ext4_grp_offs_to_block(ac->ac_sb, &ex); /* use do_div to get remainder (would be 64-bit modulo) */ if (do_div(start, sbi->s_stripe) == 0) { ac->ac_found++;