Commit 15c9eb22 authored by Andrew Vagin's avatar Andrew Vagin Committed by Pavel Emelyanov

seize: detach from all processes before waiting the root task

We need to detach from all processes before waiting the root
task, because one of these processes may collect processes from a
target pid namespace. The pid namespace is destroyed only when all
processes have been killed and collected.

https://jira.sw.ru/browse/PSBM-43089Signed-off-by: 's avatarAndrew Vagin <avagin@virtuozzo.com>
Acked-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 2f80e54c
...@@ -452,10 +452,16 @@ void pstree_switch_state(struct pstree_item *root_item, int st) ...@@ -452,10 +452,16 @@ void pstree_switch_state(struct pstree_item *root_item, int st)
for_each_pstree_item(item) for_each_pstree_item(item)
unseize_task_and_threads(item, st); unseize_task_and_threads(item, st);
/*
* We need to detach from all processes before waiting the init
* process, because one of these processes may collect processes from a
* target pid namespace. The pid namespace is destroyed only when all
* processes have been killed and collected.
*/
freezer_detach();
if (st == TASK_DEAD) if (st == TASK_DEAD)
pstree_wait(root_item); pstree_wait(root_item);
freezer_detach();
} }
static pid_t item_ppid(const struct pstree_item *item) static pid_t item_ppid(const struct pstree_item *item)
......
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