From bbbe4f264a7ef3b0b74288afb3fa0be8bb919ea4 Mon Sep 17 00:00:00 2001 From: Andrei Vagin Date: Thu, 2 Feb 2017 03:04:22 +0300 Subject: [PATCH] restore: call close_pid_proc() if a child is shared a parent fd table There are a number of global variables around this descriptor (e.g. open_proc_fd) and their values are saved in memory which are not shared between processes. travis-ci: success for Dump and restore nested network namespaces (rev4) Signed-off-by: Andrei Vagin Reviewed-by: Dmitry Safonov Signed-off-by: Pavel Emelyanov --- criu/cr-restore.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/criu/cr-restore.c b/criu/cr-restore.c index 3a1c0cd9e..72fb55c2b 100644 --- a/criu/cr-restore.c +++ b/criu/cr-restore.c @@ -1233,6 +1233,9 @@ static inline int fork_with_pid(struct pstree_item *item) BUG_ON(pid != INIT_PID); } + if (ca.clone_flags & CLONE_FILES) + close_pid_proc(); + /* * Some kernel modules, such as netwrok packet generator * run kernel thread upon net-namespace creattion taking