From: Christoph Hellwig Date: Wed, 2 Aug 2023 15:41:24 +0000 (+0200) Subject: ext4: make the IS_EXT2_SB/IS_EXT3_SB checks more robust X-Git-Tag: v6.6.17~4097^2~27 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4b41828be268544286794c18200e83861de3554e;p=platform%2Fkernel%2Flinux-rpi.git ext4: make the IS_EXT2_SB/IS_EXT3_SB checks more robust Check for sb->s_type which is the right place to look at the file system type, not the holder, which is just an implementation detail in the VFS helpers. Signed-off-by: Christoph Hellwig Acked-by: Theodore Ts'o Reviewed-by: Jan Kara Reviewed-by: Christian Brauner Message-Id: <20230802154131.2221419-6-hch@lst.de> Signed-off-by: Christian Brauner --- diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 17c3e79..fa8888f 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -141,7 +141,7 @@ static struct file_system_type ext2_fs_type = { }; MODULE_ALIAS_FS("ext2"); MODULE_ALIAS("ext2"); -#define IS_EXT2_SB(sb) ((sb)->s_bdev->bd_holder == &ext2_fs_type) +#define IS_EXT2_SB(sb) ((sb)->s_type == &ext2_fs_type) #else #define IS_EXT2_SB(sb) (0) #endif @@ -157,7 +157,7 @@ static struct file_system_type ext3_fs_type = { }; MODULE_ALIAS_FS("ext3"); MODULE_ALIAS("ext3"); -#define IS_EXT3_SB(sb) ((sb)->s_bdev->bd_holder == &ext3_fs_type) +#define IS_EXT3_SB(sb) ((sb)->s_type == &ext3_fs_type) static inline void __ext4_read_bh(struct buffer_head *bh, blk_opf_t op_flags,