<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7654.12">
<TITLE>RE: [PATCH] Re: linux-next: build warning after merge of the xfs tree</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<P><FONT SIZE=2>> Dave Chinner <<A HREF="mailto:david@fromorbit.com">mailto:david@fromorbit.com</A>> wrote:<BR>
> On Thu, Mar 04, 2010 at 11:19:30AM +1100, Stephen Rothwell wrote:<BR>
> > Hi Dave,<BR>
> ><BR>
> > After merging the xfs tree, today's linux-next build (x86_64 allmodconfig)<BR>
> > produced this warning:<BR>
> ><BR>
> > fs/xfs/linux-2.6/xfs_aops.c: In function 'xfs_end_io':<BR>
> > fs/xfs/linux-2.6/xfs_aops.c:232: warning: 'error' may be used uninitialized in this function<BR>
> ><BR>
> > Introduced by commit 77d7a0c2eeb285c9069e15396703d0cb9690ac50 ("xfs:<BR>
> > Non-blocking inode locking in IO completion").<BR>
> ><BR>
> > I can't tell if this is a false positive. If the first two "if"<BR>
> > statement bodies are skipped, then error is tested uninitialised. It is<BR>
> > possible that at least one of them has to be executed.<BR>
><BR>
> Right, there is a warning being generated there - I thought I fixed<BR>
> that immediately after posting the first version of the patch. The<BR>
> second version:<BR>
><BR>
> <A HREF="http://oss.sgi.com/archives/xfs/2010-02/msg00340.html">http://oss.sgi.com/archives/xfs/2010-02/msg00340.html</A><BR>
><BR>
> definitely had it fixed.<BR>
><BR>
> Alex, can you make sure you take the entire patch rather than<BR>
> cutting and pasting bits from one patch version to another? That<BR>
> way you don't miss small changes to the patch that might have been<BR>
> forgotten about....<BR>
<BR>
I didn't expect you would change the patch content, only<BR>
the description. I had already tested the previous code<BR>
so just grabbed the new description when you re-posted.<BR>
Sorry about the warning slipping through. I'll incorporate<BR>
your fix below (tomorrow).<BR>
<BR>
-Alex<BR>
<BR>
<BR>
> Stephen, the patch below should fix the warning.<BR>
><BR>
> Cheers,<BR>
><BR>
> Dave.<BR>
> --<BR>
> Dave Chinner<BR>
> david@fromorbit.com<BR>
><BR>
> xfs: fix uninitialised variable warning in xfs_end_io<BR>
><BR>
> Signed-off-by: Dave Chinner <david@fromorbit.com><BR>
> ---<BR>
> fs/xfs/linux-2.6/xfs_aops.c | 2 +-<BR>
> 1 files changed, 1 insertions(+), 1 deletions(-)<BR>
><BR>
> diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c<BR>
> index f41a2d8..8989c16 100644<BR>
> --- a/fs/xfs/linux-2.6/xfs_aops.c<BR>
> +++ b/fs/xfs/linux-2.6/xfs_aops.c<BR>
> @@ -230,7 +230,7 @@ xfs_end_io(<BR>
> {<BR>
> xfs_ioend_t *ioend = container_of(work, xfs_ioend_t, io_work);<BR>
> struct xfs_inode *ip = XFS_I(ioend->io_inode);<BR>
> - int error;<BR>
> + int error = 0;<BR>
> <BR>
> /*<BR>
> * For unwritten extents we need to issue transactions to convert a<BR>
><BR>
><BR>
</FONT>
</P>
</BODY>
</HTML>