]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ext4: check buffer_verified in advance to avoid unneeded ext4_get_group_info()
authorKemeng Shi <shikemeng@huaweicloud.com>
Tue, 20 Aug 2024 13:22:34 +0000 (21:22 +0800)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 4 Sep 2024 02:12:16 +0000 (22:12 -0400)
Check buffer_verified in advance to avoid unneeded ext4_get_group_info().
This could be a simple cleanup as compiler may handle this.

Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
Link: https://patch.msgid.link/20240820132234.2759926-8-shikemeng@huaweicloud.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/ialloc.c

index daacb9f0ef50afbbb880bf062a180c120c0536ac..7f1a5f90dbbdfff76d4d5e95ced11de3f8e8bf4e 100644 (file)
@@ -87,10 +87,10 @@ static int ext4_validate_inode_bitmap(struct super_block *sb,
        if (EXT4_SB(sb)->s_mount_state & EXT4_FC_REPLAY)
                return 0;
 
-       grp = ext4_get_group_info(sb, block_group);
-
        if (buffer_verified(bh))
                return 0;
+
+       grp = ext4_get_group_info(sb, block_group);
        if (!grp || EXT4_MB_GRP_IBITMAP_CORRUPT(grp))
                return -EFSCORRUPTED;