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 <avagin@virtuozzo.com>
Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
Andrei Vagin 2017-02-02 03:04:22 +03:00
parent 5759076cea
commit bbbe4f264a

View file

@ -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