]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ext4: simplify device handling
authorChristian Brauner <brauner@kernel.org>
Tue, 24 Oct 2023 14:53:41 +0000 (16:53 +0200)
committerChristian Brauner <brauner@kernel.org>
Sat, 18 Nov 2023 13:59:24 +0000 (14:59 +0100)
We removed all codepaths where s_umount is taken beneath open_mutex and
bd_holder_lock so don't make things more complicated than they need to
be and hold s_umount over block device opening.

Link: https://lore.kernel.org/r/20231024-vfs-super-rework-v1-3-37a8aa697148@kernel.org
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/ext4/super.c

index c5fcf377ab1faad832c9165fd2ed299d9c3e94f6..bd752f3f1dd526d9935f9d5796f0f617c03213d8 100644 (file)
@@ -5864,11 +5864,8 @@ static struct bdev_handle *ext4_get_journal_blkdev(struct super_block *sb,
        struct ext4_super_block *es;
        int errno;
 
-       /* see get_tree_bdev why this is needed and safe */
-       up_write(&sb->s_umount);
        bdev_handle = bdev_open_by_dev(j_dev, BLK_OPEN_READ | BLK_OPEN_WRITE,
                                       sb, &fs_holder_ops);
-       down_write(&sb->s_umount);
        if (IS_ERR(bdev_handle)) {
                ext4_msg(sb, KERN_ERR,
                         "failed to open journal device unknown-block(%u,%u) %ld",