Fix ckpt_obj_lookup_add() leak detection logic
PATCH 1/1 Fix ckpt_obj_lookup_add() leak detection logic
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.
--- checkpoint/objhash.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
checkpoint/objhash.c +1 -1
@@ -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 ;
Signature · 1 line
1.6.2.5
A message that is not in the archive (sent off-list or not yet received): 1253207274-7563-1-git-send-email-danms-r/[email protected]
Got it, thanks.
Quoted 24 lines · Dan Smith
Since first is a pointer, it's never NULL and thus leak detection will always be performed (of
CHECKPOINT_SUBTREEis set). This fatally breaks the checkpoint process when that flag is enabled because any object (with aref_usersoperation) that is added to the hash twice will be reported as a reverse leak.Signed-off-by Dan Smith <danms-r/[email protected]>--- checkpoint/objhash.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)checkpoint/objhash.c +1
-1@@ -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 ;