[PATCH 1/3] Set the CHECKPOINTED flag on objects before calling checkpoint

Dan Smith danms at us.ibm.com
Mon Aug 24 10:11:56 PDT 2009


This helps prevent infinite recursion where the checkpoint() operation on an
object could potentially result in another checkpoint() of itself.

UNIX sockets would easily encounter this when we call checkpoint on all
related sockets, which would in turn try to checkpoint us again.


Signed-off-by: Dan Smith <danms at us.ibm.com>
---
 checkpoint/objhash.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/checkpoint/objhash.c b/checkpoint/objhash.c
index dc0a10a..019077b 100644
--- a/checkpoint/objhash.c
+++ b/checkpoint/objhash.c
@@ -677,9 +677,8 @@ int checkpoint_obj(struct ckpt_ctx *ctx, void *ptr, enum obj_type type)
 
 		/* invoke callback to actually dump the state */
 		BUG_ON(!obj->ops->checkpoint);
-		ret = obj->ops->checkpoint(ctx, ptr);
-
 		obj->flags |= CKPT_OBJ_CHECKPOINTED;
+		ret = obj->ops->checkpoint(ctx, ptr);
 	}
 
 	obj->flags |= CKPT_OBJ_VISITED;
-- 
1.6.2.5



More information about the Containers mailing list