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:
committed by
Pavel Emelyanov
parent
84c48e6244
commit
1edfe53b71
11
mount.c
11
mount.c
@@ -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;
|
||||||
|
Reference in New Issue
Block a user