On Tue, 2011-09-20 at 17:59 -0400, Christoph Hellwig wrote:
> Libxfs_readbuf may return a NULL buffer to indicate that an error happend
> during the read, but we currently ignore that if libxfs_trans_read_buf
> is called with a NULL transaction pointer. Fix this by copying the
> relevant code from the kernel version of the routine, and also tidy
> the code up a bit by using a common exit label.
>
> This fixes a regression that was introduced in xfsprogs 3.0.0 by commit
>
> "Implement buffer and inode caching in libxfs, groundwork for a
> parallel version of xfs_repair."
>
> Signed-off-by: Christoph Hellwig <hch@xxxxxx>
Probably wouldn't hurt to initialize b_fsprivate2 even
if the transaction pointer is null. Looks good though.
Reviewed-by: Alex Elder <aelder@xxxxxxx>
. . .
> @@ -510,6 +516,7 @@ libxfs_trans_read_buf(
>
> /* initialise b_fsprivate2 so we can find it incore */
> XFS_BUF_SET_FSPRIVATE2(bp, tp);
> +done:
> *bpp = bp;
> return 0;
> }
|