[Top] [All Lists]

Re: [PATCH 1/4] libxfs: handle read errors in libxfs_trans_read_buf

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [PATCH 1/4] libxfs: handle read errors in libxfs_trans_read_buf
From: Alex Elder <aelder@xxxxxxx>
Date: Wed, 21 Sep 2011 13:45:07 -0500
Cc: <xfs@xxxxxxxxxxx>
In-reply-to: <20110920220030.204339904@xxxxxxxxxxxxxxxxxxxxxx>
References: <20110920215917.508421839@xxxxxxxxxxxxxxxxxxxxxx> <20110920220030.204339904@xxxxxxxxxxxxxxxxxxxxxx>
Reply-to: <aelder@xxxxxxx>
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;
>  }

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