[CRIU] [PATCH 07/27] mounts: share one root for all namespaces

Pavel Emelyanov xemul at parallels.com
Fri Apr 11 05:08:48 PDT 2014


On 04/10/2014 03:03 PM, Andrey Vagin wrote:
> Currently we support nested mount namespaces, only if all of them have
> the same root.
> 
> crtools doesn't mount root, so it should be bind-mounted for all
> namespaces.
> 
> Signed-off-by: Andrey Vagin <avagin at openvz.org>
> ---
>  mount.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/mount.c b/mount.c
> index bd2da62..8c91e05 100644
> --- a/mount.c
> +++ b/mount.c
> @@ -242,6 +242,12 @@ static struct mount_info *mnt_build_ids_tree(struct mount_info *list)
>  					m->mnt_id, m->parent_mnt_id, m->mountpoint,
>  					root ? "found" : "not found");
>  			if (root && m->is_ns_root) {
> +				if (!mounts_equal(root, m, true) ||
> +					(strcmp(root->root, m->root))) {

Isn't it equal to mounts_equal(root, m, false) ?

> +					pr_err("Nested mount namespaces with different roots are not supported yet");
> +					return NULL;
> +				}
> +
>  				/*
>  				 * A root of a sub mount namespace is
>  				 * mounted in a temporary directory in the
> 




More information about the CRIU mailing list