Route opens through fs_bdev_file_open_by_path() so each external device
is registered against the correct superblock, and convert the matching
releases.

Signed-off-by: Christian Brauner (Amutable) <[email protected]>
---
 fs/ext4/super.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 6a77db4d3124..8108d999008e 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -5793,7 +5793,7 @@ failed_mount8: __maybe_unused
        brelse(sbi->s_sbh);
        if (sbi->s_journal_bdev_file) {
                invalidate_bdev(file_bdev(sbi->s_journal_bdev_file));
-               bdev_fput(sbi->s_journal_bdev_file);
+               fs_bdev_file_release(sbi->s_journal_bdev_file, sb);
        }
 out_fail:
        invalidate_bdev(sb->s_bdev);
@@ -5972,9 +5972,9 @@ static struct file *ext4_get_journal_blkdev(struct 
super_block *sb,
        struct ext4_super_block *es;
        int errno;
 
-       bdev_file = bdev_file_open_by_dev(j_dev,
+       bdev_file = fs_bdev_file_open_by_dev(j_dev,
                BLK_OPEN_READ | BLK_OPEN_WRITE | BLK_OPEN_RESTRICT_WRITES,
-               sb, &fs_holder_ops);
+               sb, sb);
        if (IS_ERR(bdev_file)) {
                ext4_msg(sb, KERN_ERR,
                         "failed to open journal device unknown-block(%u,%u) 
%ld",
@@ -6034,7 +6034,7 @@ static struct file *ext4_get_journal_blkdev(struct 
super_block *sb,
 out_bh:
        brelse(bh);
 out_bdev:
-       bdev_fput(bdev_file);
+       fs_bdev_file_release(bdev_file, sb);
        return ERR_PTR(errno);
 }
 
@@ -6073,7 +6073,7 @@ static journal_t *ext4_open_dev_journal(struct 
super_block *sb,
 out_journal:
        ext4_journal_destroy(EXT4_SB(sb), journal);
 out_bdev:
-       bdev_fput(bdev_file);
+       fs_bdev_file_release(bdev_file, sb);
        return ERR_PTR(errno);
 }
 
@@ -7492,7 +7492,7 @@ static void ext4_kill_sb(struct super_block *sb)
        kill_block_super(sb);
 
        if (bdev_file)
-               bdev_fput(bdev_file);
+               fs_bdev_file_release(bdev_file, sb);
 }
 
 static struct file_system_type ext4_fs_type = {

-- 
2.47.3


Reply via email to