Commit bbbe4f26 authored by Andrei Vagin's avatar Andrei Vagin

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: 's avatarAndrei Vagin <avagin@virtuozzo.com>
Reviewed-by: 's avatarDmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 5759076c
...@@ -1233,6 +1233,9 @@ static inline int fork_with_pid(struct pstree_item *item) ...@@ -1233,6 +1233,9 @@ static inline int fork_with_pid(struct pstree_item *item)
BUG_ON(pid != INIT_PID); BUG_ON(pid != INIT_PID);
} }
if (ca.clone_flags & CLONE_FILES)
close_pid_proc();
/* /*
* Some kernel modules, such as netwrok packet generator * Some kernel modules, such as netwrok packet generator
* run kernel thread upon net-namespace creattion taking * run kernel thread upon net-namespace creattion taking
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment