aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libfc/fc_fcp.c
diff options
context:
space:
mode:
authorVasu Dev <vasu.dev@intel.com>2010-07-20 18:19:20 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-07-28 10:05:45 -0400
commite0d93c5bc47ae270ea38192c9a49f660e0406060 (patch)
treea9afbd6d43a53f3daef25885026984924888d740 /drivers/scsi/libfc/fc_fcp.c
parentd058fd31c7f44960b00566bda39c85377f461a7b (diff)
[SCSI] libfc: IO errors on link down due to cable unplug
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 to user with EIO error followed by these 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 EIO errors, such timed out incomplete IOs needs to be re-queued without counting retry attempt and this patch does that using DID_REQUEUE scsi code. Signed-off-by: Vasu Dev <vasu.dev@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/libfc/fc_fcp.c')
-rw-r--r--drivers/scsi/libfc/fc_fcp.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c
index a0a3ae7d8611..61a12970bd14 100644
--- a/drivers/scsi/libfc/fc_fcp.c
+++ b/drivers/scsi/libfc/fc_fcp.c
@@ -1971,6 +1971,11 @@ static void fc_io_compl(struct fc_fcp_pkt *fsp)
1971 break; 1971 break;
1972 } 1972 }
1973 1973
1974 if (lport->state != LPORT_ST_READY && fsp->status_code != FC_COMPLETE) {
1975 sc_cmd->result = (DID_REQUEUE << 16);
1976 FC_FCP_DBG(fsp, "Returning DID_REQUEUE to scsi-ml\n");
1977 }
1978
1974 spin_lock_irqsave(&si->scsi_queue_lock, flags); 1979 spin_lock_irqsave(&si->scsi_queue_lock, flags);
1975 list_del(&fsp->list); 1980 list_del(&fsp->list);
1976 spin_unlock_irqrestore(&si->scsi_queue_lock, flags); 1981 spin_unlock_irqrestore(&si->scsi_queue_lock, flags);