[CRIU] [PATCH 1/3] mount: allow to dump and restore nested mount namespaces

Andrey Vagin avagin at openvz.org
Mon Jan 27 05:38:47 PST 2014


Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 namespaces.c | 2 +-
 pstree.c     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/namespaces.c b/namespaces.c
index 91e15b8..6373d33 100644
--- a/namespaces.c
+++ b/namespaces.c
@@ -182,7 +182,7 @@ static unsigned int generate_ns_id(int pid, unsigned int kid, struct ns_desc *nd
 			BUG_ON(current_ns_mask & nd->cflag);
 			pr_info("Will take %s namespace in the image\n", nd->str);
 			current_ns_mask |= nd->cflag;
-		} else {
+		} else if (nd->cflag != CLONE_NEWNS) {
 			pr_err("Can't dump nested %s namespace for %d\n",
 					nd->str, pid);
 			return 0;
diff --git a/pstree.c b/pstree.c
index 1c5f240..8740990 100644
--- a/pstree.c
+++ b/pstree.c
@@ -643,7 +643,7 @@ set_mask:
 		if (item == root_item) {
 			pr_info("Will restore in %lx namespaces\n", cflags);
 			current_ns_mask = cflags & CLONE_ALLNS;
-		} else if (cflags & CLONE_ALLNS) {
+		} else if (cflags & (CLONE_ALLNS & ~CLONE_NEWNS)) {
 			pr_err("Can't restore sub-task in NS\n");
 			return -1;
 		}
-- 
1.8.3.1



More information about the CRIU mailing list