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

Christoph Hellwig hch at infradead.org
Thu Dec 3 10:58:44 CST 2009


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 at lst.de>




More information about the xfs mailing list