[v2,05/21] restore: Convert waited helpers and zombies pids in parent's pid_ns

Submitted by Kirill Tkhai on May 31, 2017, 5:52 p.m.

Details

Message ID 149625314846.18060.15946216631054643479.stgit@localhost.localdomain
State Accepted
Series "Add /proc/[pid]/ns/pid_for_children ns support (and fixes)"
Headers show

Commit Message

Kirill Tkhai May 31, 2017, 5:52 p.m.
Parent waits them by pid in its active pid namespace. So,
it's need to converts them there instead of using vpid().

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

Patch hide | download patch | download mbox

diff --git a/criu/cr-restore.c b/criu/cr-restore.c
index 06ffe9a8b..f0d0fc5e0 100644
--- a/criu/cr-restore.c
+++ b/criu/cr-restore.c
@@ -720,6 +720,7 @@  static int prepare_sigactions(CoreEntry *core)
 
 static int __collect_child_pids(struct pstree_item *p, int state, unsigned int *n)
 {
+	int level = current->pid->level;
 	struct pstree_item *pi;
 
 	list_for_each_entry(pi, &p->children, sibling) {
@@ -733,7 +734,7 @@  static int __collect_child_pids(struct pstree_item *p, int state, unsigned int *
 			return -1;
 
 		(*n)++;
-		*child = vpid(pi);
+		*child = pi->pid->ns[level-1].virt;
 	}
 
 	return 0;