const struct xfs_buf_ops *ops)
{
struct xfs_buf *bp = NULL;
- struct xfs_buf_log_item *bip;
int error;
*bpp = NULL;
if (bp) {
ASSERT(xfs_buf_islocked(bp));
ASSERT(bp->b_transp == tp);
- ASSERT(bp->b_log_item != NULL);
ASSERT(!bp->b_error);
ASSERT(bp->b_flags & XBF_DONE);
+ ASSERT(atomic_read(&bp->b_log_item->bli_refcount) > 0);
+ ASSERT(bp->b_ops);
/*
* We never locked this buf ourselves, so we shouldn't
return -EIO;
}
- /*
- * Check if the caller is trying to read a buffer that is
- * already attached to the transaction yet has no buffer ops
- * assigned. Ops are usually attached when the buffer is
- * attached to the transaction, or by the read caller if
- * special circumstances. That didn't happen, which is not
- * how this is supposed to go.
- *
- * If the buffer passes verification we'll let this go, but if
- * not we have to shut down. Let the transaction cleanup code
- * release this buffer when it kills the tranaction.
- */
- ASSERT(bp->b_ops != NULL);
- error = xfs_buf_reverify(bp, ops);
- if (error) {
- xfs_buf_ioerror_alert(bp, __return_address);
-
- if (tp->t_flags & XFS_TRANS_DIRTY)
- xfs_force_shutdown(tp->t_mountp,
- SHUTDOWN_META_IO_ERROR);
-
- /* bad CRC means corrupted metadata */
- if (error == -EFSBADCRC)
- error = -EFSCORRUPTED;
- return error;
- }
-
- bip = bp->b_log_item;
- bip->bli_recur++;
-
- ASSERT(atomic_read(&bip->bli_refcount) > 0);
- trace_xfs_trans_read_buf_recur(bip);
- ASSERT(bp->b_ops != NULL || ops == NULL);
+ bp->b_log_item->bli_recur++;
+ trace_xfs_trans_read_buf_recur(bp->b_log_item);
*bpp = bp;
return 0;
}