[CRIU] [PATCH 1/2] mnt: do_new_mount should restore sharing

Oleg Nesterov oleg at redhat.com
Thu Apr 16 09:58:34 PDT 2015


On 04/15, Tycho Andersen wrote:
>
> The function masks off sharing in the initial setting, but doesn't correctly
> reset the flags afterwards.

Yes.

> --- a/mount.c
> +++ b/mount.c
> @@ -1789,7 +1789,9 @@ static int do_new_mount(struct mount_info *mi)
>  		return -1;
>  	}
>
> -	if (restore_shared_options(mi, 0, mi->shared_id, 0))
> +	if (restore_shared_options(mi, !mi->shared_id && !mi->master_id,
> +					mi->shared_id,
> +					mi->master_id))

I can't review this change because of the lack of knowledge, although
it looks corect to me, and at least this matches do_mount_root().


But I'd like to ask the question... Shouldn't (or can't) we know these
slave/shared/etc at dump time? IOW, can't restore_shared_options() rely
more on mi->flags?

Say, can't we at least kill the "bool slave" argument and change it
to check "mi->flags & MS_SLAVE" instead?

Just curious.

Oleg.



More information about the CRIU mailing list