[CRIU] [PATCH] mount: don't overmount a mount if it should be bind-mounted somewhere

Pavel Emelyanov xemul at virtuozzo.com
Fri Apr 29 04:55:57 PDT 2016


On 04/28/2016 11:08 PM, Andrey Vagin wrote:
> From: Andrew Vagin <avagin at virtuozzo.com>
> 
> It's impossiable to make a bind-mount if a source is overmounted.
> 
> Reported-by: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>
> Signed-off-by: Andrew Vagin <avagin at virtuozzo.com>
> ---
>  criu/mount.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/criu/mount.c b/criu/mount.c
> index 0b1c2ba..9dcd7d2 100644
> --- a/criu/mount.c
> +++ b/criu/mount.c
> @@ -2554,6 +2554,14 @@ static bool can_mount_now(struct mount_info *mi)
>  	if (!mi->parent)
>  		return true;
>  
> +	if (strcmp(mi->parent->mountpoint, mi->mountpoint) == 0) {
> +		struct mount_info *b;
> +
> +		list_for_each_entry(b, &mi->parent->mnt_bind, mnt_bind)
> +			if (!b->mounted)
> +				return false;

Source is overmounted and we say "can't mount now", that's OK. But where's
the guarantee that the source will stop being such, so we'll be able to truen
true from here?

> +	}
> +
>  	if (mi->external)
>  		goto shared;
>  
> 



More information about the CRIU mailing list