[CRIU] [PATCH] restore: die properly if restore_one_task fails

Pavel Emelyanov xemul at parallels.com
Fri Aug 29 05:46:00 PDT 2014


On 08/28/2014 10:14 PM, Tycho Andersen wrote:
> This is really just the last bit of c32046c9; if restore_one_task() fails, we
> need to do the same futex wakeup we do everywhere else in this function.
> 
> Signed-off-by: Tycho Andersen <tycho.andersen at canonical.com>
> ---
>  cr-restore.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/cr-restore.c b/cr-restore.c
> index cefa78e..ec4b648 100644
> --- a/cr-restore.c
> +++ b/cr-restore.c
> @@ -1467,7 +1467,10 @@ static int restore_task_with_children(void *_arg)
>  	if (current->parent == NULL && fini_mnt_ns())
>  		goto err_fini_mnt;
>  
> -	return restore_one_task(current->pid.virt, ca->core);
> +	if (restore_one_task(current->pid.virt, ca->core))
> +		goto err_fini_mnt;

The fini_mnt, that will be called on err_fini_mnt laber, is called one 
function above. Shouldn't this be "goto err" instead?

> +
> +	return 0;
>  
>  err_fini_mnt:
>  	if (current->parent == NULL)
> 



More information about the CRIU mailing list