From: "Serge E. Hallyn" <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
To: Oren Laadan <orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
Cc: Linux Containers <containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org>
Subject: [PATCH 1/1] clean up checkpoint_task_objs
Date: Mon, 14 Dec 2009 13:41:45 -0600 [thread overview]
Message-ID: <20091214194145.GA21259@us.ibm.com> (raw)
Make the flow more regular. With the existing code, one can barely
find the call to checkpoint_task_obj_ns() even if looking for it!
This is on top of the task->fs c/r patch I sent last week.
Signed-off-by: Serge E. Hallyn <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
---
checkpoint/process.c | 17 ++++++++++++-----
1 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/checkpoint/process.c b/checkpoint/process.c
index 603bbf4..bef909a 100644
--- a/checkpoint/process.c
+++ b/checkpoint/process.c
@@ -247,12 +247,17 @@ static int checkpoint_task_objs(struct ckpt_ctx *ctx, struct task_struct *t)
ret = checkpoint_task_creds(ctx, t);
ckpt_debug("cred: objref %d\n", ret);
- if (!ret) {
- ret = checkpoint_task_ns(ctx, t);
- ckpt_debug("ns: objref %d\n", ret);
+ if (ret < 0) {
+ ckpt_err(ctx, ret, "%(T)process credentials\n");
+ return ret;
}
- if (ret < 0)
+
+ ret = checkpoint_task_ns(ctx, t);
+ ckpt_debug("ns: objref %d\n", ret);
+ if (ret < 0) {
+ ckpt_err(ctx, ret, "%(T)process namespaces\n");
return ret;
+ }
fs_objref = checkpoint_get_task_fs(ctx, t);
if (fs_objref < 0) {
@@ -291,8 +296,10 @@ static int checkpoint_task_objs(struct ckpt_ctx *ctx, struct task_struct *t)
signal_objref = ckpt_obj_lookup_add(ctx, t->signal,
CKPT_OBJ_SIGNAL, &first);
ckpt_debug("signal: objref %d\n", signal_objref);
- if (signal_objref < 0)
+ if (signal_objref < 0) {
+ ckpt_err(ctx, signal_objref, "%(T)process signals\n");
return signal_objref;
+ }
h = ckpt_hdr_get_type(ctx, sizeof(*h), CKPT_HDR_TASK_OBJS);
if (!h)
--
1.6.0.4
next reply other threads:[~2009-12-14 19:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-14 19:41 Serge E. Hallyn [this message]
[not found] ` <20091214194145.GA21259-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-12-23 0:47 ` [PATCH 1/1] clean up checkpoint_task_objs Oren Laadan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091214194145.GA21259@us.ibm.com \
--to=serue-r/jw6+rmf7hqt0dzr+alfa@public.gmane.org \
--cc=containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org \
--cc=orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox