Message ID | 20230417110617.2664129-4-shikemeng@huaweicloud.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1855587vqo; Sun, 16 Apr 2023 20:26:44 -0700 (PDT) X-Google-Smtp-Source: AKy350ZAdbxbjXAODhvSKdPMSuNtr5uo4fkGfsAAoXABa131sR5PQy9hGre3ed4F3qy57evjW0lz X-Received: by 2002:a05:6a21:6d8b:b0:ef:f887:40cb with SMTP id wl11-20020a056a216d8b00b000eff88740cbmr1243849pzb.4.1681702004392; Sun, 16 Apr 2023 20:26:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681702004; cv=none; d=google.com; s=arc-20160816; b=U/hZ1HmxfMKVbdy/CxHRcMJFfbkC95STQjcfmEcHv2bDnCgyr4bEx1Bwgom5EanCPX 8WUkt/6+t7zyG1WG2DUBxxGVx+z/Ujag2iJji4bY2AmTw5fgBjaG0NfEyz4IfEhD5g/I rw/EYM9mgn9wRmMepHrVAIIAXg+0NJHmfaM1aGp13TPqgHuF4QyxR4kycrrA8vL6c25W dRlb4u/J4bJdt/nvG4QIBFgB6y2M6qG96ow3mxPIEtDjd+XMDgg9WKp8cY8inVWV5ou7 UT7DbVAytE483qiQPMmCSASl+suXZu4twR4JvBmKqFcyZwbyvXKx9HAmmz1gNXGiYWKO dL1A== 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=z1/q0iRCS86YAL+CI0lsVwTCuZAb0sBwdShikn2arQs=; b=sfZ8bqkqvt9AXbsrQ/JwlQNXbxKKWd/RBrdh+SwPQiAjIV+gw7PkKfaTdyzCh7ry2S y0p9R9b/MCNBn7+7l0+3+Mz0u01SJWldwj2N/BZSFDp4b3AD7z01CZRLpXB7j5kz1P/1 9Fftz4cRTtqTJk2RDUmgqjRAk4rtKULCeswHrG+Qbl1412+SCiVHjBnqLQUy5VAb9pl+ m1OgOz8k/yACHtvyfncBL7tNftNbbAwpP2x0ep7itZTOjAaM2oE6bA1HGwmlGHb7QHZK PRGa1c8Fp1y1mYl/rdf1Cyi2iQVvW7XAGo1aLQS6IJEp6wMSE7sYKdaxCGSwh3M+90Tm LP0A== 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 bm18-20020a656e92000000b0051b2f70fc85si11382864pgb.16.2023.04.16.20.26.30; Sun, 16 Apr 2023 20:26:44 -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 S229556AbjDQDEU (ORCPT <rfc822;leviz.kernel.dev@gmail.com> + 99 others); Sun, 16 Apr 2023 23:04:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229488AbjDQDEA (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 16 Apr 2023 23:04:00 -0400 Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 681F426BE; Sun, 16 Apr 2023 20:03:58 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4Q0Bhp05mMz4f3jLd; Mon, 17 Apr 2023 11:03:54 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP1 (Coremail) with SMTP id cCh0CgAXODIXtzxkfzJgHA--.17426S5; Mon, 17 Apr 2023 11:03:55 +0800 (CST) From: Kemeng Shi <shikemeng@huaweicloud.com> To: tytso@mit.edu, adilger.kernel@dilger.ca, ojaswin@linux.ibm.com Cc: linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, shikemeng@huaweicloud.com Subject: [PATCH v3 03/19] ext4: fix wrong unit use in ext4_mb_find_by_goal Date: Mon, 17 Apr 2023 19:06:01 +0800 Message-Id: <20230417110617.2664129-4-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20230417110617.2664129-1-shikemeng@huaweicloud.com> References: <20230417110617.2664129-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: cCh0CgAXODIXtzxkfzJgHA--.17426S5 X-Coremail-Antispam: 1UD129KBjvdXoWrZFWUCw4UZF4rCr4Duw43trb_yoWftwc_A3 WqyrWkGFWrJw1fC3WSyw4rtrn3Ka18Jr1jgFWrtF15WF1qgrW0ka4qkr43Zwn7Wa1UXa9x KrnxXry8CF1F9jkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbqAYFVCjjxCrM7AC8VAFwI0_Wr0E3s1l1xkIjI8I6I8E6xAIw20E Y4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l87I20VAvwVAaII0Ic2I_JFv_Gryl82 xGYIkIc2x26280x7IE14v26r1rM28IrcIa0xkI8VCY1x0267AKxVW8JVW5JwA2ocxC64kI II0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20xvE14v26w1j6s0DM28EF7 xvwVC0I7IYx2IY6xkF7I0E14v26r4UJVWxJr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2 z4x0Y4vEx4A2jsIEc7CjxVAFwI0_GcCE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4 xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v2 6r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwACjI8F5VA0II8E6I AqYI8I648v4I1l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAq x4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r 1DMIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF 7I0E14v26r4j6F4UMIIF0xvE42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxV WUJVW8JwCI42IY6I8E87Iv6xkF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjTR HMKAUUUUU X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=2.5 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, KHOP_HELO_FCRDNS,MAY_BE_FORGED,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** 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?1763392361143308166?= X-GMAIL-MSGID: =?utf-8?q?1763392361143308166?= |
Series |
Fixes, cleanups and unit test for mballoc
|
|
Commit Message
Kemeng Shi
April 17, 2023, 11:06 a.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> Reviewed-by: Ojaswin Mujoo <ojaswin@linux.ibm.com> --- 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 fbbd19cec1c9..6c699bedee81 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++;