diff options
author | Jeff Skirvin <jeffrey.d.skirvin@intel.com> | 2011-10-27 18:04:56 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2011-10-31 05:15:17 -0400 |
commit | c2cb8a5fd7d5d8729a4fc25937c4d6564f9a7aa3 (patch) | |
tree | b562e8cea25801037a4b22a79630bfbc5bd667a3 | |
parent | 0e2e27990e2dcd415f7974e8460a2f05accdddfb (diff) |
[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: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r-- | drivers/scsi/isci/task.c | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/drivers/scsi/isci/task.c b/drivers/scsi/isci/task.c index e2d9418683ce..e8cf17b024a4 100644 --- a/drivers/scsi/isci/task.c +++ b/drivers/scsi/isci/task.c | |||
@@ -212,16 +212,27 @@ int isci_task_execute_task(struct sas_task *task, int num, gfp_t gfp_flags) | |||
212 | task->task_state_flags &= ~SAS_TASK_AT_INITIATOR; | 212 | task->task_state_flags &= ~SAS_TASK_AT_INITIATOR; |
213 | spin_unlock_irqrestore(&task->task_state_lock, flags); | 213 | spin_unlock_irqrestore(&task->task_state_lock, flags); |
214 | 214 | ||
215 | /* Indicate QUEUE_FULL so that the scsi | 215 | if (test_bit(IDEV_GONE, &idev->flags)) { |
216 | * midlayer retries. if the request | 216 | |
217 | * failed for remote device reasons, | 217 | /* Indicate that the device |
218 | * it gets returned as | 218 | * is gone. |
219 | * SAS_TASK_UNDELIVERED next time | 219 | */ |
220 | * through. | 220 | isci_task_refuse(ihost, task, |
221 | */ | 221 | SAS_TASK_UNDELIVERED, |
222 | isci_task_refuse(ihost, task, | 222 | SAS_DEVICE_UNKNOWN); |
223 | SAS_TASK_COMPLETE, | 223 | } else { |
224 | SAS_QUEUE_FULL); | 224 | /* Indicate QUEUE_FULL so that |
225 | * the scsi midlayer retries. | ||
226 | * If the request failed for | ||
227 | * remote device reasons, it | ||
228 | * gets returned as | ||
229 | * SAS_TASK_UNDELIVERED next | ||
230 | * time through. | ||
231 | */ | ||
232 | isci_task_refuse(ihost, task, | ||
233 | SAS_TASK_COMPLETE, | ||
234 | SAS_QUEUE_FULL); | ||
235 | } | ||
225 | } | 236 | } |
226 | } | 237 | } |
227 | } | 238 | } |