[CRIU] [PATCH] dump/files: remove a leftover from dead_pid_conflict

Pavel Tikhomirov ptikhomirov at virtuozzo.com
Thu Jul 19 11:28:00 MSK 2018


In commit 23b769498cb3 ("dump: optimize dead_pid_conflict by searching
in rbtree") we'd replaced for_each_pstree_item and thread walk search
with pstree_pid_by_virt (rb-tree search). The latter already found us
the thread with conflicting pid if it exists, the only thing left is to
skip if the thread is also a main thread of the thread group (as it was
before patch). But some leftover left which checks something wrong: we
index ->threads array with "i", but "i" is not a number of the thread
it is a number of current dead pid.

Not sure if it helps with the initial bug and duplicates, but it might:
https://jira.sw.ru/browse/PSBM-55217

Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
---
 criu/files-reg.c | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/criu/files-reg.c b/criu/files-reg.c
index 112acc159..b3fc41357 100644
--- a/criu/files-reg.c
+++ b/criu/files-reg.c
@@ -1006,18 +1006,9 @@ int dead_pid_conflict(void)
 		if (!node)
 			continue;
 
-		if (node->state != TASK_THREAD) {
-			struct pstree_item *item;
-
-			/*
-			 * If the dead PID was given to a main thread of another
-			 * process, this is handled during restore.
-			 */
-			item = node->item;
-			if (item->pid->real == item->threads[i].real ||
-			    item->threads[i].ns[0].virt != pid)
-				continue;
-		}
+		/* Main thread */
+		if (node->state != TASK_THREAD)
+			continue;
 
 		pr_err("Conflict with a dead task with the same PID as of this thread (virt %d, real %d).\n",
 			node->ns[0].virt, node->real);
-- 
2.17.0



More information about the CRIU mailing list