[v4,15/41] pstree: Skip zombie dumping tricks if there is kdat.has_nspid

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

Details

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

Commit Message

Kirill Tkhai May 4, 2017, 4:07 p.m.
In case of kdat.has_nspid == true, zombie pids are already
dumped.

v4: New

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

Patch hide | download patch | download mbox

diff --git a/criu/cr-dump.c b/criu/cr-dump.c
index 83c4907c5..a8efe7e24 100644
--- a/criu/cr-dump.c
+++ b/criu/cr-dump.c
@@ -1109,6 +1109,7 @@  static int dump_zombies(void)
 			continue;
 
 		if (vpid(item) < 0) {
+			BUG_ON(kdat.has_nspid);
 			if (!pidns)
 				vpid(item) = item->pid->real;
 			else if (root_item == item) {
@@ -1122,8 +1123,10 @@  static int dump_zombies(void)
 		if (parse_pid_stat(vpid(item), &pps_buf) < 0)
 			goto err;
 
-		vsid(item) = pps_buf.sid;
-		vpgid(item) = pps_buf.pgid;
+		if (!kdat.has_nspid) {
+			vsid(item) = pps_buf.sid;
+			vpgid(item) = pps_buf.pgid;
+		}
 
 		BUG_ON(!list_empty(&item->children));
 		if (dump_one_zombie(item, &pps_buf) < 0)