[CRIU] [PATCH v3 4/6] user_ns: Keep root_user_ns ns fd in fdstore
Kirill Tkhai
ktkhai at virtuozzo.com
Sat Apr 1 04:37:47 PDT 2017
This improves uniformity. Also, this will be used in next patch.
Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
criu/namespaces.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/criu/namespaces.c b/criu/namespaces.c
index b2348378..1cfe8bec 100644
--- a/criu/namespaces.c
+++ b/criu/namespaces.c
@@ -2201,15 +2201,16 @@ static int create_user_ns_hierarhy_fn(void *in_arg)
p_futex = &p_arg->futex;
me = p_arg->me;
+ me->user.nsfd_id = store_self_ns(me);
+ if (me->user.nsfd_id < 0) {
+ pr_err("Can't add fd to fdstore\n");
+ goto out;
+ }
+
if (p_futex) {
/* Set self pid to allow parent restore user_ns maps */
p_arg->pid = get_self_real_pid();
futex_set_and_wake(p_futex, NS__CREATED);
- me->user.nsfd_id = store_self_ns(me);
- if (me->user.nsfd_id < 0) {
- pr_err("Can't add fd to fdstore\n");
- goto out;
- }
futex_wait_while_lt(p_futex, NS__MAPS_POPULATED);
if (prepare_userns_creds()) {
More information about the CRIU
mailing list