* [PATCH 1/1] cr: user_ns: fix trivial errors
@ 2009-06-16 20:58 Serge E. Hallyn
0 siblings, 0 replies; only message in thread
From: Serge E. Hallyn @ 2009-06-16 20:58 UTC (permalink / raw)
To: Oren Laadan; +Cc: Linux Containers
Use the right identifier out of CKPT_OBJ_USER and CKPT_OBJ_USER_NS.
Don't do ckpt_hdr_put() twice in do_restore_user_ns
Don't ifdef CONFIG_USER_NS in user_namespace.c which is only compiled
when CONFIG_USER_NS.
Signed-off-by: Serge E. Hallyn <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
---
kernel/user.c | 2 +-
kernel/user_namespace.c | 7 ++-----
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/kernel/user.c b/kernel/user.c
index 58ec18d..820cc2c 100644
--- a/kernel/user.c
+++ b/kernel/user.c
@@ -545,7 +545,7 @@ static int do_checkpoint_user(struct ckpt_ctx *ctx, struct user_struct *u)
do {
ns = save_u->user_ns;
save_u = ns->creator;
- if (ckpt_obj_lookup(ctx, save_u, CKPT_OBJ_USER_NS))
+ if (ckpt_obj_lookup(ctx, save_u, CKPT_OBJ_USER))
goto found;
unsaved_creators[unsaved_ns_nr++] = save_u;
if (unsaved_ns_nr == step * UNSAVED_STRIDE) {
diff --git a/kernel/user_namespace.c b/kernel/user_namespace.c
index a8a46a3..eb1a714 100644
--- a/kernel/user_namespace.c
+++ b/kernel/user_namespace.c
@@ -125,7 +125,7 @@ static int do_checkpoint_userns(struct ckpt_ctx *ctx, struct user_namespace *ns)
root_ns = task_cred_xxx(ctx->root_task, user)->user_ns;
if (ns != root_ns) {
creator_ref = ckpt_obj_lookup(ctx, ns->creator,
- CKPT_OBJ_USER_NS);
+ CKPT_OBJ_USER);
if (!creator_ref)
return -EINVAL;
}
@@ -163,9 +163,7 @@ static struct user_namespace *do_restore_userns(struct ckpt_ctx *ctx)
goto out;
}
-#ifdef CONFIG_USER_NS
creator = ckpt_obj_fetch(ctx, h->creator_ref, CKPT_OBJ_USER);
- ckpt_hdr_put(ctx, h);
if (IS_ERR(creator)) {
ns = ERR_PTR(-EINVAL);
goto out;
@@ -187,10 +185,9 @@ static struct user_namespace *do_restore_userns(struct ckpt_ctx *ctx)
* The objhash will keep the userns pinned until then.
*/
free_uid(new_root);
-#endif
out:
- ctx->stats.ipc_ns++;
+ ctx->stats.user_ns++;
ckpt_hdr_put(ctx, h);
return ns;
}
--
1.6.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2009-06-16 20:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-16 20:58 [PATCH 1/1] cr: user_ns: fix trivial errors Serge E. Hallyn
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.