[CRIU] [PATCH] restore: unlock network before disabling repair mode on sockets (v2)

Pavel Emelyanov xemul at parallels.com
Mon Jul 15 09:58:57 EDT 2013


On 07/15/2013 05:47 PM, Andrey Vagin wrote:
> Window probe is sent during disabling repair mode on a socket, so
> network must be unlocked in this moment.
> 
> https://bugzilla.openvz.org/show_bug.cgi?id=2670
> 
> v2: don't fail after unlocking network
> Signed-off-by: Andrey Vagin <avagin at openvz.org>
> ---
>  cr-restore.c | 15 ++++++++++++---
>  1 file changed, 12 insertions(+), 3 deletions(-)
> 
> diff --git a/cr-restore.c b/cr-restore.c
> index 1d014e1..f97689c 100644
> --- a/cr-restore.c
> +++ b/cr-restore.c
> @@ -1300,12 +1300,10 @@ static int restore_root_task(struct pstree_item *init)
>  		goto out;
>  
>  	pr_info("Wait until all tasks are restored\n");
> -	ret = restore_switch_stage(CR_STATE_RESTORE_CREDS);
> +	ret = restore_wait_inprogress_tasks();
>  	if (ret < 0)
>  		goto out;
>  
> -	futex_wait_until(&task_entries->nr_in_progress, 0);
> -
>  	/* Restore SIGCHLD here to skip SIGCHLD from a network sctip */
>  	ret = sigaction(SIGCHLD, &old_act, NULL);
>  	if (ret < 0) {
> @@ -1313,7 +1311,18 @@ static int restore_root_task(struct pstree_item *init)
>  		goto out;
>  	}
>  
> +	/* Unlock network before disabling repair mode on sockets */
>  	network_unlock();
> +
> +	/*
> +	 * -------------------------------------------------------------
> +	 * Below this line nothing can fail, because network is unlocked
> +	 */
> +
> +	restore_switch_stage(CR_STATE_RESTORE_CREDS);

Please. Very please. Make the __restore_switch_stage() or do_restore_switch_stage()
that just switches stages and is void return type.

> +
> +	futex_wait_until(&task_entries->nr_in_progress, 0);
> +
>  out:
>  	if (ret < 0) {
>  		struct pstree_item *pi;
> 




More information about the CRIU mailing list