Skip to contentSkip to conversation

clean up checkpoint_task_objs

PATCH Applied Serge E. Hallyn 2 participants 2 messages Dec 14, 2009 – Dec 23, 2009 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clean up checkpoint_task_objs

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.

---
 checkpoint/process.c |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)
checkpoint/process.c +12 -5
index 603bbf4..bef909a 100644
@@ -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)
Signature · 1 line
1.6.0.4

A message that is not in the archive (sent off-list or not yet received): 20091214194145.GA21259-r/[email protected]

Applied
#2 lore raw

Queued for v19-rc3, thanks.

Quoted 48 lines · Serge E. Hallyn

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.

---
 checkpoint/process.c |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)
checkpoint/process.c +12 -5
index 603bbf4..bef909a 100644
@@ -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)