Commit 761c47a9 authored by Christian Brauner's avatar Christian Brauner

fs: simplify setup_bdev_super() calls

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.orgReviewed-by: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent e419cf3e
...@@ -1601,15 +1601,7 @@ int get_tree_bdev(struct fs_context *fc, ...@@ -1601,15 +1601,7 @@ int get_tree_bdev(struct fs_context *fc,
return -EBUSY; return -EBUSY;
} }
} else { } 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); error = setup_bdev_super(s, fc->sb_flags, fc);
__super_lock_excl(s);
if (!error) if (!error)
error = fill_super(s, fc); error = fill_super(s, fc);
if (error) { if (error) {
...@@ -1653,15 +1645,7 @@ struct dentry *mount_bdev(struct file_system_type *fs_type, ...@@ -1653,15 +1645,7 @@ struct dentry *mount_bdev(struct file_system_type *fs_type,
return ERR_PTR(-EBUSY); return ERR_PTR(-EBUSY);
} }
} else { } 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); error = setup_bdev_super(s, flags, NULL);
__super_lock_excl(s);
if (!error) if (!error)
error = fill_super(s, data, flags & SB_SILENT ? 1 : 0); error = fill_super(s, data, flags & SB_SILENT ? 1 : 0);
if (error) { if (error) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment