Commit 7263054c authored by Pavel Emelyanov's avatar Pavel Emelyanov

mnt: Add comment about mntns to tasks assignment

Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
Acked-by: 's avatarAndrew Vagin <avagin@odin.com>
parent 02edd805
......@@ -2017,6 +2017,15 @@ int restore_task_mnt_ns(struct pstree_item *current)
unsigned int id = current->ids->mnt_ns_id;
struct ns_id *nsid;
/*
* Regardless of the namespace a task wants to
* live in, by that point they all will live in
* root's one (see prepare_pstree_kobj_ids() +
* get_clone_mask()). So if the current task's
* target namespace is the root's one -- it's
* already there, otherwise it will have to do
* setns().
*/
if (root_item->ids->mnt_ns_id == id)
return 0;
......
......@@ -689,7 +689,12 @@ set_mask:
* Mount namespaces are setns()-ed at
* restore_task_mnt_ns() explicitly,
* no need in creating it with its own
* temporary namespace
* temporary namespace.
*
* Root task is exceptional -- it will
* be born in a fresh new mount namespace
* which will be populated with all other
* namespaces' entries.
*/
rsti(item)->clone_flags &= ~CLONE_NEWNS;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment