[Devel] [PATCH 2/2] c/r: refuse checkpoint of restarting tasks

Oren Laadan orenl at cs.columbia.edu
Mon Aug 2 14:55:24 PDT 2010


This patch adds a test to forbid checkpoint attempts of
tasks that are still restarting.

Signed-off-by: Oren Laadan <orenl at cs.columbia.edu>
---
 kernel/checkpoint/checkpoint.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/kernel/checkpoint/checkpoint.c b/kernel/checkpoint/checkpoint.c
index 5e7f15c..55f4dc2 100644
--- a/kernel/checkpoint/checkpoint.c
+++ b/kernel/checkpoint/checkpoint.c
@@ -268,6 +268,12 @@ static int may_checkpoint_task(struct ckpt_ctx *ctx, struct task_struct *t)
 		return -EBUSY;
 	}
 
+	/* is task restarting ? (ok to ignore task_lock, task is frozen) */
+	if (t->checkpoint_ctx) {
+		_ckpt_err(ctx, -EBUSY, "%(T)Task is restarting\n");
+		return -EBUSY;
+	}
+
 	/* FIX: add support for ptraced tasks */
 	if (task_ptrace(t)) {
 		_ckpt_err(ctx, -EBUSY, "%(T)Task is ptraced\n");
-- 
1.7.0.4

_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list