[CRIU] [PATCH] mnt: Allow for external mounts to be fsroot ones

Dengguangxing dengguangxing at huawei.com
Fri Dec 25 16:45:22 PST 2015


criu-dump just failed with an error while bind-mounting nfs and block-device root
directory because of this fs_type check.

This patch do solve these problems :) and for me nfs and block-device bind-mount
just works fine now.

在 2015/12/24 20:27, Pavel Emelyanov 写道:
> Right now if we bind-mount / of some FS into container and want this
> to be 'external' mount, criu would refuse to dump this mountpoint.
> 
> Tune the check in validate_mounts() to always accept any external mps
> regardless of whether they are fsroot or not.
> 
> https://github.com/xemul/criu/issues/93
> 
> Signed-off-by: Pavel Emelyanov <xemul at parallels.com>
> ---
>  mount.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/mount.c b/mount.c
> index 7c42608..9a87a95 100644
> --- a/mount.c
> +++ b/mount.c
> @@ -664,6 +664,9 @@ static int validate_mounts(struct mount_info *info, bool for_dump)
>  		if (m->shared_id && validate_shared(m))
>  			return -1;
>  
> +		if (m->external)
> +			goto skip_fstype;
> +
>  		/*
>  		 * Mountpoint can point to / of an FS. In that case this FS
>  		 * should be of some known type so that we can just mount one.
> @@ -681,7 +684,7 @@ static int validate_mounts(struct mount_info *info, bool for_dump)
>  						m->mountpoint, m->s_dev, m->root, m->mnt_id);
>  				return -1;
>  			}
> -		} else if (!m->external) {
> +		} else {
>  			t = find_fsroot_mount_for(m);
>  			if (!t) {
>  				int ret;
> @@ -712,7 +715,7 @@ static int validate_mounts(struct mount_info *info, bool for_dump)
>  				}
>  			}
>  		}
> -
> +skip_fstype:
>  		list_for_each_entry(t, &m->parent->children, siblings) {
>  			if (m == t)
>  				continue;
> 



More information about the CRIU mailing list