libxfs: handle read errors in libxfs_trans_read_buf
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@lst.de> Signed-off-by: Alex Elder <aelder@sgi.com>