Skip to content

Commit 71cf10c

Browse files
author
Al Viro
committed
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>
1 parent 1a22542 commit 71cf10c

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

fs/namespace.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3080,14 +3080,12 @@ static struct file *open_detached_copy(struct path *path, bool recursive)
30803080
return ERR_CAST(mnt);
30813081
}
30823082

3083-
lock_mount_hash();
30843083
for (p = mnt; p; p = next_mnt(p, mnt)) {
30853084
mnt_add_to_ns(ns, p);
30863085
ns->nr_mounts++;
30873086
}
30883087
ns->root = mnt;
30893088
mntget(&mnt->mnt);
3090-
unlock_mount_hash();
30913089
namespace_unlock();
30923090

30933091
mntput(path->mnt);

0 commit comments

Comments
 (0)