Skip to contentSkip to conversation

nilfs2: simplify device handling

PATCH Applied Jan Kara 3 participants 3 messages Nov 1, 2023 – Nov 2, 2023

Subsystems (2)
lore
Share & tools
lore

Jan Kara

author reviewer
#0 lore raw

PATCH 1/1 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.

---
 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?

fs/nilfs2/super.c +0 -8
index a5d1fa4e7552..df8674173b22 100644
@@ -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);
Signature · 1 line
2.35.3
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Jan Kara

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.

---
 fs/nilfs2/super.c | 8 --------
 1 file changed, 8 deletions(-)

I had missed that cleanup patch set. Thank you!

Quoted 3 lines

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

Quoted 24 lines
fs/nilfs2/super.c +0 -9
index a5d1fa4e7552..df8674173b22 100644
@@ -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

maintainer Applied
#2 lore raw
In reply to Jan Kara
Quoted 5 lines · Jan Kara

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