summaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
authorKemeng Shi <shikemeng@huaweicloud.com>2024-08-20 15:22:34 +0200
committerTheodore Ts'o <tytso@mit.edu>2024-09-04 04:12:16 +0200
commit7d2b48881877ace14ea85a7e3a17ff8f80f3d8e6 (patch)
treecd42146af3caeff9ace86996f078796a8b3c5707 /fs/ext4
parentext4: remove unneeded NULL check of buffer_head in ext4_mark_inode_used() (diff)
downloadlinux-7d2b48881877ace14ea85a7e3a17ff8f80f3d8e6.tar.xz
linux-7d2b48881877ace14ea85a7e3a17ff8f80f3d8e6.zip
ext4: check buffer_verified in advance to avoid unneeded ext4_get_group_info()
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>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/ialloc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
index daacb9f0ef50..7f1a5f90dbbd 100644
--- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -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;