* state here rather than mount state to avoid corrupting the log tail
* on shutdown.
*/
- if (bp->b_mount->m_log && xlog_is_shutdown(bp->b_mount->m_log))
+ if (bp->b_mount->m_log && xlog_is_shutdown(bp->b_mount->m_log)) {
+ xfs_buf_ioerror(bp, -EIO);
goto ioerror;
+ }
if (bp->b_flags & XBF_WRITE)
xfs_buf_wait_unpin(bp);
bp->b_error = 0;
if ((bp->b_flags & XBF_WRITE) && !xfs_buf_verify_write(bp)) {
+ /* ->verify_write should have set b_error already */
xfs_force_shutdown(bp->b_mount, SHUTDOWN_CORRUPT_INCORE);
- goto end_io;
+ goto ioerror;
}
/* In-memory targets are directly mapped, no I/O required. */
ioerror:
bp->b_flags &= ~XBF_DONE;
xfs_buf_stale(bp);
- xfs_buf_ioerror(bp, -EIO);
end_io:
xfs_buf_ioend(bp);
}