[CRIU] [PATCH 01/20] collect: Check for ns being mnt before collecting

Pavel Emelyanov xemul at parallels.com
Tue Apr 22 09:34:45 PDT 2014


Signed-off-by: Pavel Emelyanov <xemul at parallels.com>
---
 mount.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/mount.c b/mount.c
index 12ff5bd..227e3fb 100644
--- a/mount.c
+++ b/mount.c
@@ -1867,6 +1867,9 @@ int collect_mnt_namespaces(void)
 	int ret = -1;
 
 	for (ns = ns_ids; ns; ns = ns->next) {
+		if (!(ns->nd->cflag & CLONE_NEWNS))
+			continue;
+
 		if (ns->pid == getpid()) {
 			if (!(root_ns_mask & CLONE_NEWNS)) {
 				mntinfo = collect_mntinfo(ns);
@@ -1877,9 +1880,6 @@ int collect_mnt_namespaces(void)
 			continue;
 		}
 
-		if (!(ns->nd->cflag & CLONE_NEWNS))
-			continue;
-
 		pr_info("Dump MNT namespace (mountpoints) %d via %d\n",
 				ns->id, ns->pid);
 		pms = collect_mntinfo(ns);
-- 
1.7.6.5


More information about the CRIU mailing list