xfs
[Top] [All Lists]

Re: [PATCH 2/5] repair: fix some valgrind reported errors on i686

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH 2/5] repair: fix some valgrind reported errors on i686
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Sun, 9 Oct 2011 19:45:29 -0400
Cc: xfs@xxxxxxxxxxx
In-reply-to: <1318201910-11144-3-git-send-email-david@xxxxxxxxxxxxx>
References: <1318201910-11144-1-git-send-email-david@xxxxxxxxxxxxx> <1318201910-11144-3-git-send-email-david@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Mon, Oct 10, 2011 at 10:11:47AM +1100, Dave Chinner wrote:
> From: Dave Chinner <dchinner@xxxxxxxxxx>
> 
> Fix a potential prefetch read problem due to the first loop
> execution of pf_batch_read potentially not initialising the fsbno
> varaible:

variable.

> 
> ==10177== Thread 6:
> ==10177== Conditional jump or move depends on uninitialised value(s)
> ==10177==    at 0x8079CAB: pf_batch_read (prefetch.c:408)
> ==10177==    by 0x6A2996D: clone (clone.S:130)
> ==10177==
> 
> Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
> ---
>  repair/prefetch.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/repair/prefetch.c b/repair/prefetch.c
> index d2fdf90..da074a8 100644
> --- a/repair/prefetch.c
> +++ b/repair/prefetch.c
> @@ -397,7 +397,7 @@ pf_batch_read(
>       int                     len, size;
>       int                     i;
>       int                     inode_bufs;
> -     unsigned long           fsbno;
> +     unsigned long           fsbno = 0;

Call me stupid, but I can't see how this could actually be a real
life issue.  The first thing we do in the loop is to to write
to fsbno in btree_find.  I'm fine adding this to shut up warnins,
but I can't see a real issue.

<Prev in Thread] Current Thread [Next in Thread>