[PATCH 09/25] libxfs: make libxfs_readbufr stash the error value in b_error

Darrick J. Wong
2020-02-25T00:14:45Z

Make libxfs_readbufr stash the error value in b_error, which will make
the behavior consistent between regular and multi-mapping buffers.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
---
libxfs/rdwr.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/libxfs/rdwr.c b/libxfs/rdwr.c
index fb22c118..9ee9d557 100644
--- a/libxfs/rdwr.c
+++ b/libxfs/rdwr.c
@@ -936,6 +936,7 @@ libxfs_readbufr(struct xfs_buftarg *btp, xfs_daddr_t blkno, xfs_buf_t *bp,
pthread_self(), __FUNCTION__, bytes, error,
(long long)LIBXFS_BBTOOFF64(blkno), (long long)blkno, bp);
#endif
+ bp->b_error = error;
return error;
}

@@ -995,9 +996,7 @@ libxfs_readbuf(
* contents. *cough* xfs_da_node_buf_ops *cough*.
*/
error = libxfs_readbufr(btp, blkno, bp, len, flags);
- if (error)
- bp->b_error = error;
- else
+ if (!error)
libxfs_readbuf_verify(bp, ops);
return bp;
}