aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhihao Cheng <[email protected]>2023-03-15 09:31:24 +0800
committerTheodore Ts'o <[email protected]>2023-06-26 19:35:13 -0400
commit93e92cfcc1977b2b914c75333aa4b629b2fa7ca2 (patch)
tree74344ad4dcd3b5419bf206266ae7835265f5f486
parent26fb5290240dc31cae99b8b4dd2af7f46dfcba6b (diff)
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/[email protected]/ Signed-off-by: Zhihao Cheng <[email protected]> Reviewed-by: Jan Kara <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Theodore Ts'o <[email protected]>
-rw-r--r--fs/ext4/super.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 6a8c5c3c9126..fcc8dad6b661 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1333,7 +1333,7 @@ static void ext4_put_super(struct super_block *sb)
sync_blockdev(sb->s_bdev);
invalidate_bdev(sb->s_bdev);
- if (sbi->s_journal_bdev && sbi->s_journal_bdev != sb->s_bdev) {
+ if (sbi->s_journal_bdev) {
sync_blockdev(sbi->s_journal_bdev);
ext4_blkdev_remove(sbi);
}