[CRIU] [PATCH 2/2] zdtm: check shared mounts more carefully

Pavel Emelyanov xemul at parallels.com
Fri Dec 18 04:26:10 PST 2015


On 12/18/2015 11:44 AM, Andrey Vagin wrote:
> From: Andrew Vagin <avagin at virtuozzo.com>

Plz, elaborate what "more carefully" means here.

> Signed-off-by: Andrew Vagin <avagin at virtuozzo.com>
> ---
>  test/zdtm/live/static/mntns_shared_bind.c | 16 +++++++++++-----
>  1 file changed, 11 insertions(+), 5 deletions(-)
> 
> diff --git a/test/zdtm/live/static/mntns_shared_bind.c b/test/zdtm/live/static/mntns_shared_bind.c
> index d90f969..f11b2df 100644
> --- a/test/zdtm/live/static/mntns_shared_bind.c
> +++ b/test/zdtm/live/static/mntns_shared_bind.c
> @@ -79,12 +79,13 @@ int main(int argc, char **argv)
>  
>  		task_waiter_complete(&t, 1);
>  		task_waiter_wait4(&t, 2);
> -
> -
> -		if (umount(bpath)) {
> +		if (umount(spath)) {
> +			task_waiter_complete(&t, 2);
>  			fail("umount");
>  			return 1;
>  		}
> +		task_waiter_complete(&t, 3);
> +		task_waiter_wait4(&t, 4);
>  
>  		return 0;
>  	}
> @@ -100,11 +101,16 @@ int main(int argc, char **argv)
>  	test_daemon();
>  	test_waitsig();
>  
> -	if (umount(spath)) {
> +	task_waiter_complete(&t, 2);
> +	task_waiter_wait4(&t, 3);
> +
> +	if (umount(bpath)) {
> +		task_waiter_complete(&t, 2);
>  		fail("umount");
>  		return 1;
>  	}
> -	task_waiter_complete(&t, 2);
> +
> +	task_waiter_complete(&t, 4);
>  
>  	if (waitpid(pid, &status, 0) != pid) {
>  		pr_perror("waitpid %d", pid);
> 



More information about the CRIU mailing list