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

Signed-off-by: Oren Laadan <[email protected]>
---
 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
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/containers

_______________________________________________
Devel mailing list
[email protected]
https://openvz.org/mailman/listinfo/devel

Reply via email to