From nobody Sat Feb 7 08:27:10 2026 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 5AE5AC433F5 for ; Mon, 23 May 2022 14:03:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236917AbiEWODv (ORCPT ); Mon, 23 May 2022 10:03:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236862AbiEWODb (ORCPT ); Mon, 23 May 2022 10:03:31 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B08C123163; Mon, 23 May 2022 07:03:30 -0700 (PDT) Received: from dggpeml500020.china.huawei.com (unknown [172.30.72.54]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4L6Jt04Slrz1JC8d; Mon, 23 May 2022 22:02:00 +0800 (CST) Received: from huawei.com (10.175.127.227) by dggpeml500020.china.huawei.com (7.185.36.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Mon, 23 May 2022 22:03:28 +0800 From: Baokun Li To: CC: , , , , , , , , , Subject: [PATCH v2 2/2] ext4: correct the judgment of BUG in ext4_mb_normalize_request Date: Mon, 23 May 2022 22:16:58 +0800 Message-ID: <20220523141658.2919003-3-libaokun1@huawei.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220523141658.2919003-1-libaokun1@huawei.com> References: <20220523141658.2919003-1-libaokun1@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.175.127.227] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpeml500020.china.huawei.com (7.185.36.88) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" When either of the "start + size <=3D ac->ac_o_ex.fe_logical" or "start > ac->ac_o_ex.fe_logical" conditions is met, it indicates that the fe_logical is not in the allocated range. In this case, it should be bug_ON. Fixes: c9de560ded61 ("ext4: Add multi block allocator for ext4") Signed-off-by: Baokun Li --- V1->V2: Change Fixes from dfe076c106f6 to c9de560ded61. fs/ext4/mballoc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 6aafc242fe23..61ced468f178 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -4185,7 +4185,7 @@ ext4_mb_normalize_request(struct ext4_allocation_cont= ext *ac, } rcu_read_unlock(); =20 - if (start + size <=3D ac->ac_o_ex.fe_logical && + if (start + size <=3D ac->ac_o_ex.fe_logical || start > ac->ac_o_ex.fe_logical) { ext4_msg(ac->ac_sb, KERN_ERR, "start %lu, size %lu, fe_logical %lu", --=20 2.31.1