In this case sync IO fails with EIO(5) errors as "Thread:1 System call error:5 - Input/output error (::pwrite() failed)".
This is due to IO time out while libfc doing link down processing to block all rports and if timed out IO was at last retry attempt then it fails with following log messages. [77848.612169] host2: rport bf0015: Delete port [77848.612221] host2: rport e10aef: work delete [77848.612232] host2: rport e10002: work event 3 [77848.612422] sd 2:0:1:1: [sdi] Unhandled error code [77848.612426] sd 2:0:1:1: [sdi] Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK [77848.612431] sd 2:0:1:1: [sdi] CDB: Write(10): 2a 00 00 00 11 20 00 00 20 00 [77848.612445] end_request: I/O error, dev sdi, sector 4384 [77848.612553] sd 2:0:1:2: [sdj] Unhandled error code To fix these errors, failed IO needs to be re-queued without counting retry attempt. It can be done using either DID_REQUEUE or DID_IMM_RETRY and these both works to fix EIO errors but not sure which one is any better for very small time window as all IOs gets blocked once rport/s blocked on link down completion. The DID_IMM_RETRY might be bit helpful to resume IO quickly once rport is unblocked but would cause several retries while rport is getting blocked, so may be DID_REQUEUE would be better to finish rport/s blocking first on link down. As I said both works fine to fix IO errors on cable unplug and I don't see much difference with either for this case, do you see? Signed-off-by: Vasu Dev <[email protected]> --- drivers/scsi/libfc/fc_fcp.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c index 8914f1e..be1782c 100644 --- a/drivers/scsi/libfc/fc_fcp.c +++ b/drivers/scsi/libfc/fc_fcp.c @@ -1973,6 +1973,11 @@ static void fc_io_compl(struct fc_fcp_pkt *fsp) break; } + if (lport->state != LPORT_ST_READY && fsp->status_code != FC_COMPLETE) { + sc_cmd->result = (DID_REQUEUE << 16); + FC_FCP_DBG(fsp, "Returning DID_REQUEUE to scsi-ml\n"); + } + spin_lock_irqsave(&si->scsi_queue_lock, flags); list_del(&fsp->list); spin_unlock_irqrestore(&si->scsi_queue_lock, flags); _______________________________________________ devel mailing list [email protected] http://www.open-fcoe.org/mailman/listinfo/devel
