Skip to content

Commit 93e92cf

Browse files
Zhihao Chengtytso
authored andcommitted
ext4: ext4_put_super: Remove redundant checking for 'sbi->s_journal_bdev'
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/ Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com> Reviewed-by: Jan Kara <jack@suse.cz> Link: https://lore.kernel.org/r/20230315013128.3911115-3-chengzhihao1@huawei.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
1 parent 26fb529 commit 93e92cf

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/ext4/super.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1333,7 +1333,7 @@ static void ext4_put_super(struct super_block *sb)
13331333

13341334
sync_blockdev(sb->s_bdev);
13351335
invalidate_bdev(sb->s_bdev);
1336-
if (sbi->s_journal_bdev && sbi->s_journal_bdev != sb->s_bdev) {
1336+
if (sbi->s_journal_bdev) {
13371337
sync_blockdev(sbi->s_journal_bdev);
13381338
ext4_blkdev_remove(sbi);
13391339
}

0 commit comments

Comments
 (0)