[CRIU] [PATCH v2 27/30] user_ns: Keep setns helpers names in costistent state with net_ns

Kirill Tkhai ktkhai at virtuozzo.com
Wed Jun 7 14:31:31 MSK 2017


v2: New

Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 criu/cr-restore.c         |    2 +-
 criu/include/namespaces.h |    4 ++--
 criu/namespaces.c         |    6 +++---
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/criu/cr-restore.c b/criu/cr-restore.c
index 96269872d..d55ed8fd2 100644
--- a/criu/cr-restore.c
+++ b/criu/cr-restore.c
@@ -1012,7 +1012,7 @@ static int restore_one_alive_task(int pid, CoreEntry *core)
 	if (restore_task_pfc_before_user_ns())
 		return -1;
 
-	if (current->ids->has_user_ns_id && set_user_ns(current->ids->user_ns_id) < 0)
+	if (current->ids->has_user_ns_id && set_userns_by_id(current->ids->user_ns_id))
 		return -1;
 
 	if (setup_uffd(pid, ta))
diff --git a/criu/include/namespaces.h b/criu/include/namespaces.h
index 3cfa9a9bf..b9e10e4e5 100644
--- a/criu/include/namespaces.h
+++ b/criu/include/namespaces.h
@@ -212,8 +212,8 @@ extern int store_self_ns(struct ns_id *ns);
 
 extern int collect_user_namespaces(bool for_dump);
 extern int prepare_userns(pid_t real_pid, UsernsEntry *e);
-extern int __set_user_ns(struct ns_id *ns);
-extern int set_user_ns(u32 id);
+extern int set_userns(struct ns_id *ns);
+extern int set_userns_by_id(u32 id);
 extern int stop_usernsd(void);
 extern int prep_usernsd_transport(void);
 
diff --git a/criu/namespaces.c b/criu/namespaces.c
index 15de9c515..0f58428bf 100644
--- a/criu/namespaces.c
+++ b/criu/namespaces.c
@@ -2545,7 +2545,7 @@ int prepare_namespace_before_tasks(void)
 	return -1;
 }
 
-int __set_user_ns(struct ns_id *ns)
+int set_userns(struct ns_id *ns)
 {
 	int fd;
 
@@ -2575,7 +2575,7 @@ int __set_user_ns(struct ns_id *ns)
 	return 0;
 }
 
-int set_user_ns(u32 id)
+int set_userns_by_id(u32 id)
 {
 	struct ns_id *ns;
 
@@ -2587,7 +2587,7 @@ int set_user_ns(u32 id)
 		pr_err("Can't find user_ns %u\n", id);
 		return -1;
 	}
-	return __set_user_ns(ns);
+	return set_userns(ns);
 }
 
 static int do_reserve_pid_ns_helpers(struct ns_id *ns, void *oarg)



More information about the CRIU mailing list