diff options
author | Brian King <brking@linux.vnet.ibm.com> | 2013-08-20 11:08:42 -0500 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2013-09-06 11:41:34 -0700 |
commit | c281e32aeea4af061264fd18843dc15984482fec (patch) | |
tree | f4441cd5055a2d3dd050f38470d146f8a7891125 /drivers/scsi/ibmvscsi | |
parent | 72264eb6dbb9090265f6c87e49db78c4306bc1c3 (diff) | |
download | linux-c281e32aeea4af061264fd18843dc15984482fec.tar.gz linux-c281e32aeea4af061264fd18843dc15984482fec.tar.bz2 linux-c281e32aeea4af061264fd18843dc15984482fec.zip |
[SCSI] ibmvfc: Fix for offlining devices during error recovery
This fixes an issue seen with devices getting marked offline
in a scenario where a VIOS was getting rebooted while a
client VFC adapter is in SCSI EH and prevents unnecessary
EH escalation in some scenarios.
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Acked-by: Robert Jennings <rcj@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/ibmvscsi')
-rw-r--r-- | drivers/scsi/ibmvscsi/ibmvfc.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c index 4e31caa21ddf..23f5ba5e6472 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc.c +++ b/drivers/scsi/ibmvscsi/ibmvfc.c @@ -2208,7 +2208,10 @@ static int ibmvfc_cancel_all(struct scsi_device *sdev, int type) if (rsp_rc != 0) { sdev_printk(KERN_ERR, sdev, "Failed to send cancel event. rc=%d\n", rsp_rc); - return -EIO; + /* If failure is received, the host adapter is most likely going + through reset, return success so the caller will wait for the command + being cancelled to get returned */ + return 0; } sdev_printk(KERN_INFO, sdev, "Cancelling outstanding commands.\n"); @@ -2221,7 +2224,15 @@ static int ibmvfc_cancel_all(struct scsi_device *sdev, int type) if (status != IBMVFC_MAD_SUCCESS) { sdev_printk(KERN_WARNING, sdev, "Cancel failed with rc=%x\n", status); - return -EIO; + switch (status) { + case IBMVFC_MAD_DRIVER_FAILED: + case IBMVFC_MAD_CRQ_ERROR: + /* Host adapter most likely going through reset, return success to + the caller will wait for the command being cancelled to get returned */ + return 0; + default: + return -EIO; + }; } sdev_printk(KERN_INFO, sdev, "Successfully cancelled outstanding commands\n"); |