[v3,10/20] ext4: remove unnecessary e4b->bd_buddy_page check in ext4_mb_load_buddy_gfp
Message ID | 20230303172120.3800725-11-shikemeng@huaweicloud.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp307448wrd; Fri, 3 Mar 2023 01:21:10 -0800 (PST) X-Google-Smtp-Source: AK7set9UK5SNXyBsfS7RnUpDyq78mYAjfgwytUwxxZzcUyFBIwu98jRsHU24d9kKgxCq2RCr4zg3 X-Received: by 2002:a17:902:ecca:b0:195:e9d4:5380 with SMTP id a10-20020a170902ecca00b00195e9d45380mr1491925plh.56.1677835270294; Fri, 03 Mar 2023 01:21:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677835270; cv=none; d=google.com; s=arc-20160816; b=UiP6AJcFrKnPu+kt8QT+XBMOEycGStvsyiofhq2eo56Yb/GHuOgRNi4qniHzVUDNMy 1ZdJ9/u4tdOOsdTdO7fqSy73oDNYNCnHP1PJvUmXIk8HonkwhzWgZIsF9YUZjC1FmGV+ 6Uo012W3l1PNZfTQbRHAzDu2Eb5ZqQCEzEutTrJbMQbynx9s00/CPTVMtLuz8QXfRqsI upjB75avvOTbD2UYVAVgBuCMdYWLeohv5ll2lF3Zh7+nnOt2o3HPj6Bz1Gu6T5IpjTob 6JIPEAiOdAyjaBI+z3f7Mfq66k1Z5mBMT4AsdkNCMjKzESZbNJ1fuPh9BiTaPJr85wDD Dr3A== 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=G/QoxnSXoO9OWs/yd4RnwVNnZcYjDWSyJ6VRjrabOAk=; b=NOFyd9+LR1xYalrNJ+JrLFQ2tvj/u79ZYAdl90VuOCANsystk8AihDAVyNn/8muA72 TCkCGi05L2SyTKHEnD+TW4aT8QdHEzwZHbFutlCVpFT9+L1+XxVrNYdxfVdrtOFVjhcQ fJyDnCxKbaLCcKdcMbsMb7Dbp0xh1s8bK6GTa9j5C6/vWlaX5xXwc1fqCa2Flsr7rtu3 ql1Ju1f8uvSjUc4N/0grLW36/mWss8zZZG0KWAP4QgYedo9GsaG8JFZ2KhEHMrt3wQCD NqVjNR4v0uTCZ4L9yatgDlRL7tGQZmonVoqk579f/X/S8jBVPmCOPe0PeKSdj2FviPq2 E7iA== 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 kl5-20020a170903074500b0019c33d386e5si1659709plb.517.2023.03.03.01.20.57; Fri, 03 Mar 2023 01:21:10 -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 S230404AbjCCJUb (ORCPT <rfc822;davidbtadokoro@gmail.com> + 99 others); Fri, 3 Mar 2023 04:20:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230047AbjCCJTz (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 3 Mar 2023 04:19:55 -0500 Received: from dggsgout12.his.huawei.com (dggsgout12.his.huawei.com [45.249.212.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 349733A853; Fri, 3 Mar 2023 01:19:54 -0800 (PST) Received: from mail02.huawei.com (unknown [172.30.67.153]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4PSj9K4Nq6z4f3l6l; Fri, 3 Mar 2023 17:19:49 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP4 (Coremail) with SMTP id gCh0CgDnnbGyuwFkFpqfEg--.45687S12; Fri, 03 Mar 2023 17:19:51 +0800 (CST) From: Kemeng Shi <shikemeng@huaweicloud.com> To: tytso@mit.edu, adilger.kernel@dilger.ca, ojaswin@linux.ibm.com, ritesh.list@gmail.com Cc: linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, shikemeng@huaweicloud.com Subject: [PATCH v3 10/20] ext4: remove unnecessary e4b->bd_buddy_page check in ext4_mb_load_buddy_gfp Date: Sat, 4 Mar 2023 01:21:10 +0800 Message-Id: <20230303172120.3800725-11-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20230303172120.3800725-1-shikemeng@huaweicloud.com> References: <20230303172120.3800725-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: gCh0CgDnnbGyuwFkFpqfEg--.45687S12 X-Coremail-Antispam: 1UD129KBjvdXoWrZr1rGF1UuF45Ar1rZry5Arb_yoW3twb_Ga 4Ikr48tr4rJr90kFn7ZwsIyws8KanY9rW8XFZ3tryUZFyUArWDZw1kur1rAa1xuFyj9rW5 CF13ZF9rJFW09jkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbDAFF20E14v26rWj6s0DM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M280x2IEY4vEnII2IxkI6r1a6r45M28IrcIa0xkI8V A2jI8067AKxVWUAVCq3wA2048vs2IY020Ec7CjxVAFwI0_Xr0E3s1l8cAvFVAK0II2c7xJ M28CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVWDJVCq3wA2z4x0Y4vE2I x0cI8IcVCY1x0267AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK 6I8E87Iv6xkF7I0E14v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4 xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8 JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20V AGYxC7MxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAF wI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc4 0Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r4j6ryUMIIF0xvE2Ix0cI8IcVCY1x0267AK xVWxJVW8Jr1lIxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r4j6F 4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x0pRvJPtU UUUU= 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?1759337796615112442?= X-GMAIL-MSGID: =?utf-8?q?1759337796615112442?= |
Series |
Some bugfix and cleanup to mballoc
|
|
Commit Message
Kemeng Shi
March 3, 2023, 5:21 p.m. UTC
e4b->bd_buddy_page is only set if we initialize ext4_buddy successfully. So e4b->bd_buddy_page is always NULL in error handle branch. Just remove the dead check. 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 9e998b5d4037..6eea1296b82a 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -1555,8 +1555,7 @@ ext4_mb_load_buddy_gfp(struct super_block *sb, ext4_group_t group, put_page(page); if (e4b->bd_bitmap_page) put_page(e4b->bd_bitmap_page); - if (e4b->bd_buddy_page) - put_page(e4b->bd_buddy_page); + e4b->bd_buddy = NULL; e4b->bd_bitmap = NULL; return ret;