From: Darrick J. Wong Date: Sun, 1 Mar 2020 17:34:10 +0000 (-0500) Subject: libxfs: make libxfs_readbufr stash the error value in b_error X-Git-Tag: v5.5.0-rc1~19 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=e214b18a2ee4a7623d1d1083836c7d9332c36456;p=thirdparty%2Fxfsprogs-dev.git libxfs: make libxfs_readbufr stash the error value in b_error 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 Reviewed-by: Christoph Hellwig Signed-off-by: Eric Sandeen --- diff --git a/libxfs/rdwr.c b/libxfs/rdwr.c index 83c6142f2..2c67edded 100644 --- a/libxfs/rdwr.c +++ b/libxfs/rdwr.c @@ -943,6 +943,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; } @@ -1002,9 +1003,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; }