[CRIU] [PATCH] mount: Don't create kids with CLONE_NEWNS

Pavel Emelyanov xemul at parallels.com
Wed May 7 04:15:37 PDT 2014


We explicitly setns() every single task by hands when restoring
mount namespaces, they can be created without the NEWNS flag.

Signed-off-by: Pavel Emelyanov <xemul at parallels.com>

---

diff --git a/pstree.c b/pstree.c
index 0c9167a..d005b64 100644
--- a/pstree.c
+++ b/pstree.c
@@ -662,6 +662,14 @@ static int prepare_pstree_kobj_ids(void)
 
 set_mask:
 		item->rst->clone_flags = cflags;
+		if (parent)
+			/*
+			 * Mount namespaces are setns()-ed at
+			 * restore_task_mnt_ns() explicitly,
+			 * no need in creating it with its own
+			 * temporary namespace
+			 */
+			item->rst->clone_flags &= ~CLONE_NEWNS;
 
 		cflags &= CLONE_ALLNS;
 


More information about the CRIU mailing list