2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-09-03 07:45:17 +00:00

mnt: Add comment why we need criu's mntns mounts for dump

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Pavel Emelyanov
2014-04-23 13:10:21 +04:00
parent f22591c99a
commit aca33ac402

13
mount.c
View File

@@ -1901,17 +1901,24 @@ static int walk_mnt_ns(int (*cb)(struct ns_id *, struct mount_info *, void *), v
continue; continue;
if (ns->pid == getpid()) { if (ns->pid == getpid()) {
/*
* Collect criu's mounts only if the target
* task does NOT live in mount namespaces to
* make smart paths resolution work.
*
* Otherwise, the necessary list of mounts
* will be collected below.
*/
if (!(root_ns_mask & CLONE_NEWNS)) { if (!(root_ns_mask & CLONE_NEWNS)) {
mntinfo = collect_mntinfo(ns); mntinfo = collect_mntinfo(ns);
if (mntinfo == NULL) if (mntinfo == NULL)
goto err; goto err;
} }
/* Skip current namespaces, which are in the list too */
continue; continue;
} }
pr_info("Dump MNT namespace (mountpoints) %d via %d\n", pr_info("Dump MNT namespace (mountpoints) %d via %d\n", ns->id, ns->pid);
ns->id, ns->pid);
pms = collect_mntinfo(ns); pms = collect_mntinfo(ns);
if (pms == NULL) if (pms == NULL)
goto err; goto err;