diff mbox series

nilfs2: simplify device handling

Message ID 20231101172739.8676-1-jack@suse.cz (mailing list archive)
State New, archived
Headers show
Series nilfs2: simplify device handling | expand

Commit Message

Jan Kara Nov. 1, 2023, 5:27 p.m. UTC
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: Jan Kara <jack@suse.cz>
---
 fs/nilfs2/super.c | 8 --------
 1 file changed, 8 deletions(-)

Hi Christian, I think you've missed this simplification in your cleanup
patches. Can you merge it please?

Comments

Ryusuke Konishi Nov. 2, 2023, 10:27 a.m. UTC | #1
On Thu, Nov 2, 2023 at 2:27 AM Jan Kara wrote:
>
> 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: Jan Kara <jack@suse.cz>
> ---
>  fs/nilfs2/super.c | 8 --------
>  1 file changed, 8 deletions(-)

Acked-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>

I had missed that cleanup patch set.  Thank you!

>
> Hi Christian, I think you've missed this simplification in your cleanup
> patches. Can you merge it please?

Thank you in advance, Christian.

Ryusuke Konishi

>
> diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c
> index a5d1fa4e7552..df8674173b22 100644
> --- a/fs/nilfs2/super.c
> +++ b/fs/nilfs2/super.c
> @@ -1314,15 +1314,7 @@ nilfs_mount(struct file_system_type *fs_type, int flags,
>                 return ERR_CAST(s);
>
>         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);
> -               down_write(&s->s_umount);
>                 if (!err)
>                         err = nilfs_fill_super(s, data,
>                                                flags & SB_SILENT ? 1 : 0);
> --
> 2.35.3
>
Christian Brauner Nov. 2, 2023, 11:10 a.m. UTC | #2
On Wed, 01 Nov 2023 18:27:39 +0100, Jan Kara wrote:
> 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.
> 
> 

Ah, thank you, Jan. I missed nilfs indeed!

---

Applied to the vfs.super branch of the vfs/vfs.git tree.
Patches in the vfs.super branch should appear in linux-next soon.

Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.

It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs.super

[1/1] nilfs2: simplify device handling
      https://git.kernel.org/vfs/vfs/c/c6a4738de282
diff mbox series

Patch

diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c
index a5d1fa4e7552..df8674173b22 100644
--- a/fs/nilfs2/super.c
+++ b/fs/nilfs2/super.c
@@ -1314,15 +1314,7 @@  nilfs_mount(struct file_system_type *fs_type, int flags,
 		return ERR_CAST(s);
 
 	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);
-		down_write(&s->s_umount);
 		if (!err)
 			err = nilfs_fill_super(s, data,
 					       flags & SB_SILENT ? 1 : 0);