[CRIU] [PATCH 06/20] mnt: Check for ns being mnt before dumping

Pavel Emelyanov xemul at parallels.com
Tue Apr 22 09:36:21 PDT 2014


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

diff --git a/mount.c b/mount.c
index 5595dd0..7d7e8ed 100644
--- a/mount.c
+++ b/mount.c
@@ -1899,6 +1899,9 @@ int dump_mnt_namespaces(void)
 	int ret = 0, n = 0;
 
 	for (ns = ns_ids; ns; ns = ns->next) {
+		if (!(ns->nd->cflag & CLONE_NEWNS))
+			continue;
+
 		/* Skip current namespaces, which are in the list too  */
 		if (ns->pid == getpid()) {
 			if (!(root_ns_mask & CLONE_NEWNS))
@@ -1908,11 +1911,7 @@ int dump_mnt_namespaces(void)
 			continue;
 		}
 
-		if (!(ns->nd->cflag & CLONE_NEWNS))
-			continue;
-
 		n++;
-
 		if (n == 2 && check_mnt_id()) {
 			pr_err("Nested mount namespaces are not supported "
 				"without mnt_id in fdinfo\n");
-- 
1.7.6.5


More information about the CRIU mailing list