Skip to content

Commit 144acef

Browse files
committed
fs: add mount namespace to rbtree late
There's no point doing that under the namespace semaphore it just gives the false impression that it protects the mount namespace rbtree and it simply doesn't. Link: https://lore.kernel.org/r/20241213-work-mount-rbtree-lockless-v3-2-6e3cdaf9b280@kernel.org Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent 62b8dee commit 144acef

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/namespace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3981,14 +3981,14 @@ struct mnt_namespace *copy_mnt_ns(unsigned long flags, struct mnt_namespace *ns,
39813981
while (p->mnt.mnt_root != q->mnt.mnt_root)
39823982
p = next_mnt(skip_mnt_tree(p), old);
39833983
}
3984-
mnt_ns_tree_add(new_ns);
39853984
namespace_unlock();
39863985

39873986
if (rootmnt)
39883987
mntput(rootmnt);
39893988
if (pwdmnt)
39903989
mntput(pwdmnt);
39913990

3991+
mnt_ns_tree_add(new_ns);
39923992
return new_ns;
39933993
}
39943994

0 commit comments

Comments
 (0)