All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix ckpt_obj_lookup_add() leak detection logic
@ 2009-09-17 17:07 Dan Smith
       [not found] ` <1253207274-7563-1-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Smith @ 2009-09-17 17:07 UTC (permalink / raw)
  To: containers-qjLDD68F18O7TbgM5vRIOg

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-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
---
 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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix ckpt_obj_lookup_add() leak detection logic
       [not found] ` <1253207274-7563-1-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
@ 2009-09-18 17:01   ` Oren Laadan
  0 siblings, 0 replies; 2+ messages in thread
From: Oren Laadan @ 2009-09-18 17:01 UTC (permalink / raw)
  To: Dan Smith; +Cc: containers-qjLDD68F18O7TbgM5vRIOg


Got it, thanks.

Dan Smith wrote:
> 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-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
> ---
>  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;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-09-18 17:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-17 17:07 [PATCH] Fix ckpt_obj_lookup_add() leak detection logic Dan Smith
     [not found] ` <1253207274-7563-1-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-09-18 17:01   ` Oren Laadan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.