Commit aca33ac4 authored by Pavel Emelyanov's avatar Pavel Emelyanov

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

Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent f22591c9
...@@ -1901,17 +1901,24 @@ static int walk_mnt_ns(int (*cb)(struct ns_id *, struct mount_info *, void *), v ...@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment