cr: user_ns: fix trivial errors
PATCH 1/1 cr: user_ns: fix trivial errors
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/[email protected]>
--- kernel/user.c | 2 +- kernel/user_namespace.c | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-)
kernel/user.c +1 -1
@@ -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) {
kernel/user_namespace.c +2 -5
@@ -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; }
Signature · 1 line
1.6.1