[CRIU] [PATCH 05/10] [v2] net: allow to dump and restore more than one network namespace

Pavel Emelyanov xemul at virtuozzo.com
Mon Feb 13 05:11:04 PST 2017


> @@ -2946,6 +2945,11 @@ static int sigreturn_restore(pid_t pid, struct task_restore_args *task_args, uns
>  	if (rst_prep_creds(pid, core, &creds_pos))
>  		goto err_nv;
>  
> +	if (current->parent == NULL) {
> +		/* Wait when all tasks restored all files */
> +		restore_wait_other_tasks();

This will effectively do

  futex_wait_while_gt(&task_entries->nr_in_progress, root_item->nr_threads);

Why is this correct? In this place there's no threads that has been spawned,
so the numbers seen in nr_in_progress is purely the number of tasks. Probably
with helpers and zombies.

-- Pavel

> +	}
> +
>  	/*
>  	 * We're about to search for free VM area and inject the restorer blob
>  	 * into it. No irrelevant mmaps/mremaps beyond this point, otherwise



More information about the CRIU mailing list