[PATCH 10/11] xfs: check xfs_buf_read_uncached returns correctly

Christoph Hellwig hch at infradead.org
Fri Sep 26 05:21:48 CDT 2014


On Thu, Sep 25, 2014 at 10:34:20PM +1000, Dave Chinner wrote:
> From: Dave Chinner <dchinner at redhat.com>
> 
> xfs_buf_read_uncached() has two failure modes. If can either return
> NULL or bp->b_error != 0 depending on the type of failure, and not
> all callers check for both. Fix it up.

This changelog still seems to be for your previous version and needs
an update now tha xfs_buf_read_uncached always returns the error
directly.

> -		return NULL;
> +		return ENOMEM;

Should be -ENOMEM these days, shouldn't it?

>  release_buf:
> -	xfs_buf_relse(bp);
> +	if (bp)
> +		xfs_buf_relse(bp);

Shouldn't bp always be valid at this point?



More information about the xfs mailing list