Commit 5a8e94c0 authored by Jan Kara's avatar Jan Kara Committed by Christian Brauner

nilfs2: simplify device handling

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.

CC: Ryusuke Konishi <konishi.ryusuke@gmail.com>
CC: <linux-nilfs@vger.kernel.org>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20231101172739.8676-1-jack@suse.czAcked-by: default avatarRyusuke Konishi <konishi.ryusuke@gmail.com>
Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent 24c372d5
...@@ -1314,15 +1314,7 @@ nilfs_mount(struct file_system_type *fs_type, int flags, ...@@ -1314,15 +1314,7 @@ nilfs_mount(struct file_system_type *fs_type, int flags,
return ERR_CAST(s); return ERR_CAST(s);
if (!s->s_root) { if (!s->s_root) {
/*
* We drop s_umount here because we need to open the bdev and
* bdev->open_mutex ranks above s_umount (blkdev_put() ->
* __invalidate_device()). It is safe because we have active sb
* reference and SB_BORN is not set yet.
*/
up_write(&s->s_umount);
err = setup_bdev_super(s, flags, NULL); err = setup_bdev_super(s, flags, NULL);
down_write(&s->s_umount);
if (!err) if (!err)
err = nilfs_fill_super(s, data, err = nilfs_fill_super(s, data,
flags & SB_SILENT ? 1 : 0); flags & SB_SILENT ? 1 : 0);
......
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