]> www.infradead.org Git - users/hch/xfsprogs.git/commitdiff
libxfs: make libxfs_readbufr stash the error value in b_error
authorDarrick J. Wong <darrick.wong@oracle.com>
Sun, 1 Mar 2020 17:34:10 +0000 (12:34 -0500)
committerEric Sandeen <sandeen@sandeen.net>
Sun, 1 Mar 2020 17:34:10 +0000 (12:34 -0500)
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>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/rdwr.c

index 83c6142f219c917e34b0e742d8015a70296fc24e..2c67edded4afc87564fd7ec5bbcd2bfc05c189a0 100644 (file)
@@ -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;
 }