[CRIU] [PATCH] mount: use correct mount namespace in open_mountpoint

Andrew Vagin avagin at odin.com
Fri Nov 13 05:19:41 PST 2015


On Wed, Nov 11, 2015 at 06:12:48PM +0300, Andrey Ryabinin wrote:
> open_mountpoint() have to operate in target's mount namespace,
> which may differ from root's namespace - root_item->pid.real.
> 
> So obtain the correct mount namespace from mount_info and use
> it in switch_ns().
>

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

> Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
> ---
>  mount.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mount.c b/mount.c
> index aea9807..3fcced5 100644
> --- a/mount.c
> +++ b/mount.c
> @@ -1085,7 +1085,7 @@ static int open_mountpoint(struct mount_info *pm)
>  		return -1;
>  	}
>  
> -	if (switch_ns(root_item->pid.real, &mnt_ns_desc, &ns_old) < 0)
> +	if (switch_ns(pm->nsid->ns_pid, &mnt_ns_desc, &ns_old) < 0)
>  		goto out;
>  
>  	mnt_path = mkdtemp(mnt_path_tmp);
> -- 
> 2.4.10
> 
> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://lists.openvz.org/mailman/listinfo/criu


More information about the CRIU mailing list