[v4,40/41] pstree: Use CLONE_NEWPID only to create child reaper of pid_ns

Submitted by Kirill Tkhai on May 4, 2017, 4:12 p.m.

Details

Message ID 149391432771.11711.18372580347894260977.stgit@localhost.localdomain
State New
Series "Nested pid namespaces support"
Headers show

Commit Message

Kirill Tkhai May 4, 2017, 4:12 p.m.
If task has no INIT_PID, then clear this clone flag.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 criu/pstree.c |    2 ++
 1 file changed, 2 insertions(+)

Patch hide | download patch | download mbox

diff --git a/criu/pstree.c b/criu/pstree.c
index defa6892b..d0b21f494 100644
--- a/criu/pstree.c
+++ b/criu/pstree.c
@@ -1113,6 +1113,8 @@  static int prepare_pstree_kobj_ids(void)
 		 * move_in_cgroup(), so drop this flag here as well.
 		 */
 		rsti(item)->clone_flags &= ~(CLONE_NEWNET | CLONE_NEWCGROUP);
+		if (last_level_pid(item->pid) != INIT_PID)
+			rsti(item)->clone_flags &= ~CLONE_NEWPID;
 
 		cflags &= CLONE_ALLNS;