From nobody Tue Feb 10 03:36:51 2026 Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6F8AF191494; Tue, 20 Aug 2024 13:25:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724160352; cv=none; b=OmM3dVqjM1eNbH3uqQBQwLrNauRBIy6nlBbqGY2B6dvnKQiluT4+ItuMrijs+4lcz8mhxmYm4dfc8ujzEPwMWfyYyDUjE6ZSllkKPJiDfoikmFqoEeCGDOb2brKGntiSvY5/k/w+bpOzoxw+VDF1Qnwp2znCNyCGVSg2gSuCdMo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724160352; c=relaxed/simple; bh=S2JmiYp/oMrFWXuRv30lp/yN0UvVbNvIglF2e9WnJ08=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=SbqVNDx/s/1I0Eh4SR726hHvJ3WtKKVghq8bJH18uF5hojaUEDF7hW8qi8i2IeS5TXsonSNwjUZF1CmzU0QNtjG+s2ogC9onfyp9jwuDuHO3PDA0cT+aaW9HUfZPTV8xO4dUPasTHAE2aFn4fuQyRdvJBP67cj7RnM6tqD0SB6w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com; spf=pass smtp.mailfrom=huaweicloud.com; arc=none smtp.client-ip=45.249.212.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaweicloud.com Received: from mail.maildlp.com (unknown [172.19.93.142]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4Wp9FY1vnwz4f3kKm; Tue, 20 Aug 2024 21:25:37 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.75]) by mail.maildlp.com (Postfix) with ESMTP id DA63E1A0359; Tue, 20 Aug 2024 21:25:46 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP2 (Coremail) with SMTP id Syh0CgDH_bxWmcRmD7_dCA--.4366S8; Tue, 20 Aug 2024 21:25:46 +0800 (CST) From: Kemeng Shi To: tytso@mit.edu, adilger.kernel@dilger.ca Cc: harshadshirwadkar@gmail.com, darrick.wong@oracle.com, akpm@osdl.org, shaggy@austin.ibm.com, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 6/7] ext4: remove unneeded NULL check of buffer_head in ext4_mark_inode_used() Date: Tue, 20 Aug 2024 21:22:33 +0800 Message-Id: <20240820132234.2759926-7-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20240820132234.2759926-1-shikemeng@huaweicloud.com> References: <20240820132234.2759926-1-shikemeng@huaweicloud.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: Syh0CgDH_bxWmcRmD7_dCA--.4366S8 X-Coremail-Antispam: 1UD129KBjvdXoWruF1Dtr17JF47GF4xXrWxtFb_yoWxKwb_t3 WxJr4xJ3yrt34xGFs0yws5Ar4SkF4Fgr1rGF93J3Wfu3WjvF4kuFyDXrsxArZru3yfKF93 CFy2vFy3JFWxXjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbfkYFVCjjxCrM7AC8VAFwI0_Wr0E3s1l1xkIjI8I6I8E6xAIw20E Y4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l82xGYIkIc2x26280x7IE14v26r126s 0DM28IrcIa0xkI8VCY1x0267AKxVW5JVCq3wA2ocxC64kIII0Yj41l84x0c7CEw4AK67xG Y2AK021l84ACjcxK6xIIjxv20xvE14v26ryj6F1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14 v26r4UJVWxJr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2z4x0Y4vEx4A2jsIEc7CjxVAF wI0_GcCE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2 WlYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7xkE bVWUJVW8JwACjcxG0xvY0x0EwIxGrwCY1x0262kKe7AKxVWUAVWUtwCF04k20xvY0x0EwI xGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480 Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jw0_GFylIxkGc2Ij64vIr41lIxAIcVC0I7 IYx2IY67AKxVWUCVW8JwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Cr0_Gr1UMIIF0xvE42xK 8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I 0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjxUwuWlUUUUU X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ Content-Type: text/plain; charset="utf-8" If gdp from ext4_get_group_desc() is not NULL, then returned group_desc_bh won't be NULL either. Remove check of group_desc_bh and only check returned gdp from ext4_get_group_desc() like how other callers do. Signed-off-by: Kemeng Shi --- fs/ext4/ialloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c index 0234f5e91d8d..daacb9f0ef50 100644 --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c @@ -772,7 +772,7 @@ int ext4_mark_inode_used(struct super_block *sb, int in= o) } =20 gdp =3D ext4_get_group_desc(sb, group, &group_desc_bh); - if (!gdp || !group_desc_bh) { + if (!gdp) { err =3D -EINVAL; goto out; } --=20 2.30.0