[Devel] [PATCH] Fix ckpt_obj_lookup_add() leak detection logic
Dan Smith
danms at us.ibm.com
Thu Sep 17 10:07:54 PDT 2009
Since first is a pointer, it's never NULL and thus leak detection will
always be performed (of CHECKPOINT_SUBTREE is set). This fatally breaks
the checkpoint process when that flag is enabled because any object (with
a ref_users operation) that is added to the hash twice will be reported as
a reverse leak.
Signed-off-by: Dan Smith <danms at us.ibm.com>
---
checkpoint/objhash.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/checkpoint/objhash.c b/checkpoint/objhash.c
index 8dfb0b0..b85aa77 100644
--- a/checkpoint/objhash.c
+++ b/checkpoint/objhash.c
@@ -679,7 +679,7 @@ int ckpt_obj_lookup_add(struct ckpt_ctx *ctx, void *ptr,
ckpt_debug("%s objref %d first %d\n",
obj->ops->obj_name, obj->objref, *first);
- if (first && obj_reverse_leak(ctx, obj))
+ if (*first && obj_reverse_leak(ctx, obj))
return -EBUSY;
obj->flags |= CKPT_OBJ_VISITED;
--
1.6.2.5
_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
More information about the Devel
mailing list