2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 22:05:36 +00:00

mounts: Connect sub-root to the main root as children

Each sub-namespace is restored as sub-tree of the root mntns, so
the parent of sub-mntns root is the root of the root mntns.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Andrey Vagin
2014-04-21 18:23:16 +04:00
committed by Pavel Emelyanov
parent 84c48e6244
commit 1edfe53b71

11
mount.c
View File

@@ -232,7 +232,16 @@ static struct mount_info *mnt_build_ids_tree(struct mount_info *list)
pr_err("Mountpoint %d w/o parent %d found @%s (root %s)\n", pr_err("Mountpoint %d w/o parent %d found @%s (root %s)\n",
m->mnt_id, m->parent_mnt_id, m->mountpoint, m->mnt_id, m->parent_mnt_id, m->mountpoint,
root ? "found" : "not found"); root ? "found" : "not found");
return NULL; if (root && m->is_ns_root) {
/*
* A root of a sub mount namespace is
* mounted in a temporary directory in the
* root mount namespace, so its parent is
* the main root.
*/
p = root;
} else
return NULL;
} }
m->parent = p; m->parent = p;