]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ext4: remove unneeded NULL check of buffer_head in ext4_mark_inode_used()
authorKemeng Shi <shikemeng@huaweicloud.com>
Tue, 20 Aug 2024 13:22:33 +0000 (21:22 +0800)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 4 Sep 2024 02:12:16 +0000 (22:12 -0400)
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 <shikemeng@huaweicloud.com>
Link: https://patch.msgid.link/20240820132234.2759926-7-shikemeng@huaweicloud.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/ialloc.c

index 0234f5e91d8d8ccb4385278f101c36fb91801f49..daacb9f0ef50afbbb880bf062a180c120c0536ac 100644 (file)
@@ -772,7 +772,7 @@ int ext4_mark_inode_used(struct super_block *sb, int ino)
        }
 
        gdp = ext4_get_group_desc(sb, group, &group_desc_bh);
-       if (!gdp || !group_desc_bh) {
+       if (!gdp) {
                err = -EINVAL;
                goto out;
        }