aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/fs/namespace.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2025-08-26 16:53:42 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2025-09-15 21:26:44 -0400
commit71cf10ce4562ed7b18f3bd44a4e2dfafd0e84c50 (patch)
treefcf225d874c50cd2d07cf10337609103f26e429c /fs/namespace.c
parentpath_has_submounts(): use guard(mount_locked_reader) (diff)
downloadwireguard-linux-71cf10ce4562ed7b18f3bd44a4e2dfafd0e84c50.tar.xz
wireguard-linux-71cf10ce4562ed7b18f3bd44a4e2dfafd0e84c50.zip
open_detached_copy(): don't bother with mount_lock_hash()
we are holding namespace_sem and a reference to root of tree; iterating through that tree does not need mount_lock. Neither does the insertion into the rbtree of new namespace or incrementing the mount count of that namespace. Reviewed-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namespace.c')
-rw-r--r--fs/namespace.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index 7489c9c716c6..468ae0cb475e 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -3080,14 +3080,12 @@ static struct file *open_detached_copy(struct path *path, bool recursive)
return ERR_CAST(mnt);
}
- lock_mount_hash();
for (p = mnt; p; p = next_mnt(p, mnt)) {
mnt_add_to_ns(ns, p);
ns->nr_mounts++;
}
ns->root = mnt;
mntget(&mnt->mnt);
- unlock_mount_hash();
namespace_unlock();
mntput(path->mnt);