[SCSI] libsas: prevent double completion of scmds from eh

We invoke task->task_done() to free the task in the eh case, but at this
point we are prepared for scsi_eh_flush_done_q() to finish off the scmd.

Introduce sas_end_task() to capture the final response status from the
lldd and free the task.

Also take the opportunity to kill this warning.
drivers/scsi/libsas/sas_scsi_host.c: In function ‘sas_end_task’:
drivers/scsi/libsas/sas_scsi_host.c:102:3: warning: case value ‘2’ not in enumerated type ‘enum exec_status’ [-Wswitch]

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
This commit is contained in:
Dan Williams 2011-12-06 23:24:42 -08:00 committed by James Bottomley
parent 3dff5721e4
commit a3a142524a
2 changed files with 37 additions and 29 deletions

View file

@ -452,7 +452,10 @@ enum service_response {
};
enum exec_status {
/* The SAM_STAT_.. codes fit in the lower 6 bits */
/* The SAM_STAT_.. codes fit in the lower 6 bits, alias some of
* them here to silence 'case value not in enumerated type' warnings
*/
__SAM_STAT_CHECK_CONDITION = SAM_STAT_CHECK_CONDITION,
SAS_DEV_NO_RESPONSE = 0x80,
SAS_DATA_UNDERRUN,