ext2: Remove redundant check on s_inode_size

This change “ext2: Remove redundant check on s_inode_size” in Linux kernel is authored by Liu Xiang <liu.xiang6 [at] zte.com.cn> on Tue Jan 15 22:10:43 2019 +0800.

ext2: Remove redundant check on s_inode_size

The case of (EXT2_INODE_SIZE(sb) == 0) is included in
(sbi->s_inode_size < EXT2_GOOD_OLD_INODE_SIZE).
So there is no need to check again.

Signed-off-by: Liu Xiang <liu.xiang6@zte.com.cn>
Signed-off-by: Jan Kara <jack@suse.cz>

This Linux change may have been applied to various maintained Linux releases and you can find Linux releases including commit f6f5014.

There are 2 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 fs/ext2/super.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/fs/ext2/super.c b/fs/ext2/super.c
index b6d8402..133012e 100644
--- a/fs/ext2/super.c
+++ b/fs/ext2/super.c
@@ -1024,8 +1024,6 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
 	sbi->s_frags_per_group = le32_to_cpu(es->s_frags_per_group);
 	sbi->s_inodes_per_group = le32_to_cpu(es->s_inodes_per_group);
-	if (EXT2_INODE_SIZE(sb) == 0)
-		goto cantfind_ext2;
 	sbi->s_inodes_per_block = sb->s_blocksize / EXT2_INODE_SIZE(sb);
 	if (sbi->s_inodes_per_block == 0 || sbi->s_inodes_per_group == 0)
 		goto cantfind_ext2;

The commit for this change in Linux stable tree is f6f5014 (patch).

Leave a Reply

Your email address will not be published. Required fields are marked *