Re: [PATCH 6/7] xfs: fix error initialization

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Oct 08, 2016 at 10:55:58AM -0500, Eric Sandeen wrote:
> On 10/7/16 6:07 PM, Darrick J. Wong wrote:
> > Eric Sandeen reported a gcc complaint about uninitialized error
> > variables, so fix that.
> > 
> > Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx>
> > Reported-by: Eric Sandeen <sandeen@xxxxxxxxxx>
> > ---
> >  fs/xfs/xfs_reflink.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > 
> > diff --git a/fs/xfs/xfs_reflink.c b/fs/xfs/xfs_reflink.c
> > index 220d263..5965e94 100644
> > --- a/fs/xfs/xfs_reflink.c
> > +++ b/fs/xfs/xfs_reflink.c
> > @@ -1437,7 +1437,7 @@ xfs_reflink_dirty_extents(
> >  	xfs_off_t		flen;
> >  	struct xfs_bmbt_irec	map[2];
> >  	int			nmaps;
> > -	int			error;
> > +	int			error = 0;
> >  
> >  	while (end - fbno > 0) {
> 
> If we should never get here w/ end <= fbno, then maybe an ASSERT is
> in order.

That should be the case - the fallocate infrastructure should be
ensuring len > 0 and we don't overflow. Followup patch, if you think
it necessary, Darrick?

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux