]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
fs: simplify setup_bdev_super() calls
authorChristian Brauner <brauner@kernel.org>
Tue, 24 Oct 2023 14:53:39 +0000 (16:53 +0200)
committerChristian Brauner <brauner@kernel.org>
Sat, 18 Nov 2023 13:59:24 +0000 (14:59 +0100)
There's no need to drop s_umount anymore now that we removed all sources
where s_umount is taken beneath open_mutex or bd_holder_lock.

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

index 78bbbb9b3ee9d673fb924f7433ad39b788e81f60..18b42281ebe2068c236adf2c85a1c8f14f2c30d9 100644 (file)
@@ -1601,15 +1601,7 @@ int get_tree_bdev(struct fs_context *fc,
                        return -EBUSY;
                }
        } else {
-               /*
-                * We drop s_umount here because we need to open the bdev and
-                * bdev->open_mutex ranks above s_umount (blkdev_put() ->
-                * bdev_mark_dead()). It is safe because we have active sb
-                * reference and SB_BORN is not set yet.
-                */
-               super_unlock_excl(s);
                error = setup_bdev_super(s, fc->sb_flags, fc);
-               __super_lock_excl(s);
                if (!error)
                        error = fill_super(s, fc);
                if (error) {
@@ -1653,15 +1645,7 @@ struct dentry *mount_bdev(struct file_system_type *fs_type,
                        return ERR_PTR(-EBUSY);
                }
        } else {
-               /*
-                * We drop s_umount here because we need to open the bdev and
-                * bdev->open_mutex ranks above s_umount (blkdev_put() ->
-                * bdev_mark_dead()). It is safe because we have active sb
-                * reference and SB_BORN is not set yet.
-                */
-               super_unlock_excl(s);
                error = setup_bdev_super(s, flags, NULL);
-               __super_lock_excl(s);
                if (!error)
                        error = fill_super(s, data, flags & SB_SILENT ? 1 : 0);
                if (error) {