[CRIU] [PATCH 1/2] mnt: Relax checks for top-mount in validate_mounts

Andrew Vagin avagin at parallels.com
Wed Jun 4 06:09:58 PDT 2014


Acked-by: Andrew Vagin <avagin at parallels.com>

On Fri, May 30, 2014 at 05:57:39PM +0400, Pavel Emelyanov wrote:
> Signed-off-by: Pavel Emelyanov <xemul at parallels.com>
> 
> ---
>  mount.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/mount.c b/mount.c
> index 1d960ae..33dc590 100644
> --- a/mount.c
> +++ b/mount.c
> @@ -313,7 +313,11 @@ static int validate_mounts(struct mount_info *info, bool call_plugins)
>  	struct mount_info *m, *t;
>  
>  	for (m = info; m; m = m->next) {
> -		if (m->parent && m->parent->shared_id) {
> +		if (m->parent == NULL)
> +			/* root mount can be any */
> +			continue;
> +
> +		if (m->parent->shared_id) {
>  			struct mount_info *ct;
>  			if (list_empty(&m->parent->mnt_share))
>  				continue;
> @@ -333,7 +337,7 @@ static int validate_mounts(struct mount_info *info, bool call_plugins)
>  			}
>  		}
>  
> -		if (m->parent && !fsroot_mounted(m)) {
> +		if (!fsroot_mounted(m)) {
>  			list_for_each_entry(t, &m->mnt_bind, mnt_bind) {
>  				if (fsroot_mounted(t) || t->parent == NULL)
>  					break;
> @@ -359,9 +363,6 @@ static int validate_mounts(struct mount_info *info, bool call_plugins)
>  			}
>  		}
>  
> -		if (m->parent == NULL)
> -			continue;
> -
>  		list_for_each_entry(t, &m->parent->children, siblings) {
>  			int tlen, mlen;
>  
> -- 
> 1.8.4.2
> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://lists.openvz.org/mailman/listinfo/criu


More information about the CRIU mailing list