提交 7962560c 编写于 作者: Z Zhihao Cheng 提交者: Yongqiang Liu

ext4: ext4_put_super: Remove redundant checking for 'sbi->s_journal_bdev'

maillist inclusion
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I6MMUV
CVE: NA

Reference: https://www.spinics.net/lists/linux-ext4/msg88237.html

--------------------------------

As discussed in [1], 'sbi->s_journal_bdev != sb->s_bdev' will always
become true if sbi->s_journal_bdev exists. Filesystem block device and
journal block device are both opened with 'FMODE_EXCL' mode, so these
two devices can't be same one. Then we can remove the redundant checking
'sbi->s_journal_bdev != sb->s_bdev' if 'sbi->s_journal_bdev' exists.

[1] https://lore.kernel.org/lkml/f86584f6-3877-ff18-47a1-2efaa12d18b2@huawei.com/

Conflicts:
	fs/ext4/super.c
	[ ee7ed3aa("ext4: rename journal_dev to s_journal_dev inside
	  ext4_sb_info") is not applied. ]
Signed-off-by: NZhihao Cheng <chengzhihao1@huawei.com>
Reviewed-by: NZhang Yi <yi.zhang@huawei.com>
Signed-off-by: NYongqiang Liu <liuyongqiang13@huawei.com>
上级 8b8c3195
...@@ -1226,7 +1226,7 @@ static void ext4_put_super(struct super_block *sb) ...@@ -1226,7 +1226,7 @@ static void ext4_put_super(struct super_block *sb)
sync_blockdev(sb->s_bdev); sync_blockdev(sb->s_bdev);
invalidate_bdev(sb->s_bdev); invalidate_bdev(sb->s_bdev);
if (sbi->journal_bdev && sbi->journal_bdev != sb->s_bdev) { if (sbi->journal_bdev) {
sync_blockdev(sbi->journal_bdev); sync_blockdev(sbi->journal_bdev);
ext4_blkdev_remove(sbi); ext4_blkdev_remove(sbi);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册