[CRIU] [PATCH 3/6] pstree: Delete excess check in read_pstree_ids()

Kirill Tkhai ktkhai at virtuozzo.com
Thu May 11 04:50:36 PDT 2017


has_pid_ns_id is checked above. In could go together with
previous patch, but I separated them for easier review.

Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 criu/pstree.c |   16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/criu/pstree.c b/criu/pstree.c
index 9c2214b04..067ce787c 100644
--- a/criu/pstree.c
+++ b/criu/pstree.c
@@ -636,15 +636,13 @@ static int read_pstree_ids(pid_t pid, TaskKobjIdsEntry **ids)
 			ret = -1;
 	}
 
-	if (!ret && (*ids)->has_pid_ns_id) {
-		if (!top_pid_ns) {
-			/*
-			 * If top_pid_ns is not set, this means that here is old dump,
-			 * which does not contain ns.img. It can have only one pid_ns,
-			 * so we set it here.
-			 */
-			top_pid_ns = lookup_ns_by_id((*ids)->pid_ns_id, &pid_ns_desc);
-		}
+	if (!ret && !top_pid_ns) {
+		/*
+		 * If top_pid_ns is not set, this means that here is old dump,
+		 * which does not contain ns.img. It can have only one pid_ns,
+		 * so we set it here.
+		 */
+		top_pid_ns = lookup_ns_by_id((*ids)->pid_ns_id, &pid_ns_desc);
 	}
 
 	return ret;



More information about the CRIU mailing list