[CRIU] [PATCH] cgroup: call fini_cgroup() on error paths

Tycho Andersen tycho.andersen at canonical.com
Wed Mar 25 07:11:56 PDT 2015


On Wed, Mar 25, 2015 at 03:42:02PM +0300, Andrey Vagin wrote:
> Currenlty if criu fails before prepare_cgroup_properties(),
> cgyard isn't umounted.
> 
> I think it's déjà vu, but it isn't :)

Ah, whoops, thanks.

Acked-by: Tycho Andersen <tycho.andersen at canonical.com>

> commit 28b0e16d730ec21a515b2686961c6312816c47f3
> Author: Andrew Vagin <avagin at openvz.org>
> Date:   Mon Aug 25 14:29:00 2014 +0400
> 
>     cgroup: call fin_cgroup() on error paths
> 
> Cc: Tycho Andersen <tycho.andersen at canonical.com>
> Cc: Saied Kazemi <saied at google.com>
> Signed-off-by: Andrey Vagin <avagin at openvz.org>
> ---
>  cr-restore.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/cr-restore.c b/cr-restore.c
> index 4d9e078..823bf15 100644
> --- a/cr-restore.c
> +++ b/cr-restore.c
> @@ -1850,10 +1850,8 @@ static int restore_root_task(struct pstree_item *init)
>  
>  	write_stats(RESTORE_STATS);
>  
> -	if (!opts.restore_detach && !opts.exec_cmd) {
> -		fini_cgroup();
> +	if (!opts.restore_detach && !opts.exec_cmd)
>  		wait(NULL);
> -	}
>  
>  	return 0;
>  
> @@ -1875,6 +1873,7 @@ out_kill:
>  	}
>  
>  out:
> +	fini_cgroup();
>  	stop_usernsd();
>  	__restore_switch_stage(CR_STATE_FAIL);
>  	pr_err("Restoring FAILED.\n");
> -- 
> 2.1.0
> 


More information about the CRIU mailing list