[CRIU] [PATCH v5 40/42] pid: Check for equality of getpid() of child to last_level_pid

Kirill Tkhai ktkhai at virtuozzo.com
Fri May 5 09:19:41 PDT 2017


Make the sanity check working in case of mutli-level pids.

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

diff --git a/criu/cr-restore.c b/criu/cr-restore.c
index 3e9ee2f41..dc3ecc63f 100644
--- a/criu/cr-restore.c
+++ b/criu/cr-restore.c
@@ -1708,8 +1708,9 @@ static int restore_task_with_children(void *_arg)
 		goto err;
 
 	pid = getpid();
-	if (vpid(current) != pid) {
-		pr_err("Pid %d do not match expected %d\n", pid, vpid(current));
+	if (last_level_pid(current->pid) != pid) {
+		pr_err("Pid %d do not match expected %d (task %d)\n",
+			pid, last_level_pid(current->pid), vpid(current));
 		set_task_cr_err(EEXIST);
 		goto err;
 	}



More information about the CRIU mailing list