libsas: prevent double completion of scmds from eh
authorDan Williams <dan.j.williams@intel.com>
Wed, 7 Dec 2011 07:24:42 +0000 (23:24 -0800)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 11 Nov 2017 13:34:50 +0000 (13:34 +0000)
commitf2765368bd876fe4223d2f46a1ae124dbe3dd9f2
treed5846243c562b769eb7cbd628f0e74de4857da77
parent9e0e927efb469f5e4c4da1e0818ecfc04fe6b82d
libsas: prevent double completion of scmds from eh

commit a3a142524aa4b1539a64a55087bf12ffa4b1f94e upstream.

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>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/scsi/libsas/sas_scsi_host.c
include/scsi/libsas.h