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/[email protected] Reviewed-by: Jeff Layton <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
1 parent 62b8dee commit 144acef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)