mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-04 12:16:51 -04:00
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>
This commit is contained in:
@@ -3981,7 +3981,6 @@ struct mnt_namespace *copy_mnt_ns(unsigned long flags, struct mnt_namespace *ns,
|
||||
while (p->mnt.mnt_root != q->mnt.mnt_root)
|
||||
p = next_mnt(skip_mnt_tree(p), old);
|
||||
}
|
||||
mnt_ns_tree_add(new_ns);
|
||||
namespace_unlock();
|
||||
|
||||
if (rootmnt)
|
||||
@@ -3989,6 +3988,7 @@ struct mnt_namespace *copy_mnt_ns(unsigned long flags, struct mnt_namespace *ns,
|
||||
if (pwdmnt)
|
||||
mntput(pwdmnt);
|
||||
|
||||
mnt_ns_tree_add(new_ns);
|
||||
return new_ns;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user