xfs
[Top] [All Lists]

Re: [PATCH] xfs_io: don't assign cvtnum() return to unsigned var

To: Eric Sandeen <sandeen@xxxxxxxxxxx>
Subject: Re: [PATCH] xfs_io: don't assign cvtnum() return to unsigned var
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Thu, 3 Dec 2009 11:58:44 -0500
Cc: xfs-oss <xfs@xxxxxxxxxxx>
In-reply-to: <4B16AFCA.5040302@xxxxxxxxxxx>
References: <4B16AFCA.5040302@xxxxxxxxxxx>
User-agent: Mutt/1.5.19 (2009-01-05)
On Wed, Dec 02, 2009 at 12:19:54PM -0600, Eric Sandeen wrote:
> cvtnum() returns -1LL for unparseable values, but if we
> assign to a signed var, we can't test it:
> 
> xfs_io> mincore 0 xxx
> range (0:0) is beyond mapping (0:1048576)
> 
> Use a temporary signed var so we can detect the error:
> 
> xfs_io> mincore 0 xxx
> non-numeric length argument -- xxx
> 
> and also test whether it may overflow a size_t.

Looks good,


Reviewed-by: Christoph Hellwig <hch@xxxxxx>

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