[CRIU] [PATCH 1/3] seize: detach from all processes before waiting the root task

Pavel Emelyanov xemul at parallels.com
Mon Jan 18 10:13:40 PST 2016


On 01/16/2016 05:57 AM, Andrey Vagin wrote:
> From: Andrew Vagin <avagin at virtuozzo.com>
> 
> 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.

This effectively reverts commit 4a393715. What do we do about the
original bug fixed by that one?

> https://jira.sw.ru/browse/PSBM-43089
> Signed-off-by: Andrew Vagin <avagin at virtuozzo.com>
> ---
>  seize.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/seize.c b/seize.c
> index 7e93d34..18f0d40 100644
> --- a/seize.c
> +++ b/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)
> 



More information about the CRIU mailing list