Commit c2cb8a5f authored by Jeff Skirvin's avatar Jeff Skirvin Committed by James Bottomley

[SCSI] isci: Immediately fail I/O to removed devices.

In the case where an I/O fails to start in isci_request_execute,
only allow retries if the device is not already gone.
Signed-off-by: default avatarJeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent 0e2e2799
...@@ -212,12 +212,22 @@ int isci_task_execute_task(struct sas_task *task, int num, gfp_t gfp_flags) ...@@ -212,12 +212,22 @@ int isci_task_execute_task(struct sas_task *task, int num, gfp_t gfp_flags)
task->task_state_flags &= ~SAS_TASK_AT_INITIATOR; task->task_state_flags &= ~SAS_TASK_AT_INITIATOR;
spin_unlock_irqrestore(&task->task_state_lock, flags); spin_unlock_irqrestore(&task->task_state_lock, flags);
/* Indicate QUEUE_FULL so that the scsi if (test_bit(IDEV_GONE, &idev->flags)) {
* midlayer retries. if the request
* failed for remote device reasons, /* Indicate that the device
* it gets returned as * is gone.
* SAS_TASK_UNDELIVERED next time */
* through. isci_task_refuse(ihost, task,
SAS_TASK_UNDELIVERED,
SAS_DEVICE_UNKNOWN);
} else {
/* Indicate QUEUE_FULL so that
* the scsi midlayer retries.
* If the request failed for
* remote device reasons, it
* gets returned as
* SAS_TASK_UNDELIVERED next
* time through.
*/ */
isci_task_refuse(ihost, task, isci_task_refuse(ihost, task,
SAS_TASK_COMPLETE, SAS_TASK_COMPLETE,
...@@ -225,6 +235,7 @@ int isci_task_execute_task(struct sas_task *task, int num, gfp_t gfp_flags) ...@@ -225,6 +235,7 @@ int isci_task_execute_task(struct sas_task *task, int num, gfp_t gfp_flags)
} }
} }
} }
}
if (status != SCI_SUCCESS && tag != SCI_CONTROLLER_INVALID_IO_TAG) { if (status != SCI_SUCCESS && tag != SCI_CONTROLLER_INVALID_IO_TAG) {
spin_lock_irqsave(&ihost->scic_lock, flags); spin_lock_irqsave(&ihost->scic_lock, flags);
/* command never hit the device, so just free /* command never hit the device, so just free
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment