diff options
author | Dan Williams <dan.j.williams@intel.com> | 2011-11-28 20:11:33 -0500 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-02-19 14:57:01 -0500 |
commit | e500a34b0257def5b9ec07563afeeada1ead87bb (patch) | |
tree | 8f504dd4f97ca52f683ee058dfabfb5b859731d5 /drivers/scsi/libsas | |
parent | b91bb296188118eea9fdc6093cfcf76bbe8589ba (diff) |
[SCSI] libsas: kill invocation of scsi_eh_finish_cmd from sas_ata_task_done
Prior to the conversion to the new-style libata-eh sas_ata_task_done()
may have been the last opportunity to clean up the scmd, but now
libata-eh explicitly handles this case. It also races against sas-eh.
If a lldd completes a task after SAS_TASK_STATE_ABORTED is set it could
trigger a spurious decrement of shost->host_failed. Current lldds have
the band-aid of checking SAS_TASK_STATE_ABORTED before calling
->task_done(), but better to just let the scmds escalate to libata for
race free cleanup.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/libsas')
-rw-r--r-- | drivers/scsi/libsas/sas_ata.c | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c index 71af919b856c..5cb0a2ae5924 100644 --- a/drivers/scsi/libsas/sas_ata.c +++ b/drivers/scsi/libsas/sas_ata.c | |||
@@ -145,20 +145,6 @@ static void sas_ata_task_done(struct sas_task *task) | |||
145 | ata_qc_complete(qc); | 145 | ata_qc_complete(qc); |
146 | spin_unlock_irqrestore(dev->sata_dev.ap->lock, flags); | 146 | spin_unlock_irqrestore(dev->sata_dev.ap->lock, flags); |
147 | 147 | ||
148 | /* | ||
149 | * If the sas_task has an ata qc, a scsi_cmnd and the aborted | ||
150 | * flag is set, then we must have come in via the libsas EH | ||
151 | * functions. When we exit this function, we need to put the | ||
152 | * scsi_cmnd on the list of finished errors. The ata_qc_complete | ||
153 | * call cleans up the libata side of things but we're protected | ||
154 | * from the scsi_cmnd going away because the scsi_cmnd is owned | ||
155 | * by the EH, making libata's call to scsi_done a NOP. | ||
156 | */ | ||
157 | spin_lock_irqsave(&task->task_state_lock, flags); | ||
158 | if (qc->scsicmd && task->task_state_flags & SAS_TASK_STATE_ABORTED) | ||
159 | scsi_eh_finish_cmd(qc->scsicmd, &sas_ha->eh_done_q); | ||
160 | spin_unlock_irqrestore(&task->task_state_lock, flags); | ||
161 | |||
162 | qc_already_gone: | 148 | qc_already_gone: |
163 | list_del_init(&task->list); | 149 | list_del_init(&task->list); |
164 | sas_free_task(task); | 150 | sas_free_task(task); |