[CRIU] [PATCH 16/20] mnt: Move local mntns collecting on restore into prepare_mnt_ns

Pavel Emelyanov xemul at parallels.com
Tue Apr 22 09:39:12 PDT 2014


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

diff --git a/cr-restore.c b/cr-restore.c
index 1ff0ffa..30c664c 100644
--- a/cr-restore.c
+++ b/cr-restore.c
@@ -1240,10 +1240,6 @@ static int restore_task_with_children(void *_arg)
 		if (prepare_namespace(current, ca->clone_flags))
 			exit(1);
 
-		if (!(root_ns_mask & CLONE_NEWNS))
-			if (rst_collect_local_mntns())
-				exit(1);
-
 		/*
 		 * We need non /proc proc mount for restoring pid and mount
 		 * namespaces and do not care for the rest of the cases.
diff --git a/include/mount.h b/include/mount.h
index aabb186..99e256e 100644
--- a/include/mount.h
+++ b/include/mount.h
@@ -32,7 +32,6 @@ extern bool phys_stat_dev_match(struct mount_info *tree, dev_t st_dev,
 extern int restore_task_mnt_ns(struct ns_id *nsid, pid_t pid);
 extern int fini_mnt_ns(void);
 
-int rst_collect_local_mntns(void);
 char *rst_get_mnt_root(int mnt_id);
 
 #endif /* __CR_MOUNT_H__ */
diff --git a/mount.c b/mount.c
index b264901..901f1f1 100644
--- a/mount.c
+++ b/mount.c
@@ -1422,7 +1422,7 @@ static int create_mnt_roots(void)
 	return 0;
 }
 
-int rst_collect_local_mntns(void)
+static int rst_collect_local_mntns(void)
 {
 	struct ns_id *nsid;
 
@@ -1711,7 +1711,7 @@ int prepare_mnt_ns(void)
 	struct ns_id ns = { .pid = getpid(), .nd = &mnt_ns_desc };
 
 	if (!(root_ns_mask & CLONE_NEWNS))
-		return 0;
+		return rst_collect_local_mntns();
 
 	pr_info("Restoring mount namespace\n");
 
-- 
1.7.6.5


More information about the CRIU mailing list