[2/4] restore: Call prepare_fds() in restore_one_zombie()

Submitted by Kirill Tkhai on Dec. 28, 2017, 9:35 a.m.

Details

Message ID 151445373933.3248.16656273968237103868.stgit@localhost.localdomain
State Accepted
Series "Fix restore of tasks having zombie pgid"
Commit 7d8c2d86a8bedd9c4ebfbb7f41777cb660ac5710
Headers show

Commit Message

Kirill Tkhai Dec. 28, 2017, 9:35 a.m.
Zombie may be choosen as parent for task helper
during solving pgid dependences. In this situation,
it becomes to share fdt with the helper and it has
to call prepare_fds() to decrement fdt->nr.

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

Patch hide | download patch | download mbox

diff --git a/criu/cr-restore.c b/criu/cr-restore.c
index de14a716b..5bebc3d61 100644
--- a/criu/cr-restore.c
+++ b/criu/cr-restore.c
@@ -1117,6 +1117,9 @@  static int restore_one_zombie(CoreEntry *core)
 
 	pr_info("Restoring zombie with %d code\n", exit_code);
 
+	if (prepare_fds(current))
+		return -1;
+
 	if (inherit_fd_fini() < 0)
 		return -1;