mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 14:25:49 +00:00
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-43089 Signed-off-by: Andrew Vagin <avagin@virtuozzo.com> Acked-by: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
2f80e54cd9
commit
15c9eb220e
10
seize.c
10
seize.c
@@ -452,10 +452,16 @@ void pstree_switch_state(struct pstree_item *root_item, int st)
|
||||
for_each_pstree_item(item)
|
||||
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)
|
||||
pstree_wait(root_item);
|
||||
|
||||
freezer_detach();
|
||||
}
|
||||
|
||||
static pid_t item_ppid(const struct pstree_item *item)
|
||||
|
Reference in New Issue
Block a user