scsi: qla2xxx: Fix race conditions in the code for aborting SCSI commands
authorBart Van Assche <bvanassche@acm.org>
Wed, 17 Apr 2019 21:44:35 +0000 (14:44 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Mon, 29 Apr 2019 21:24:51 +0000 (17:24 -0400)
commit219d27d7147e07fe899a781bd72f9180b78c3852
tree6e5335018bb6da9bdaf457a810ca5bfd65dbf2a6
parent982cc4be05d6d0d8b15b1340416737ad60bddcae
scsi: qla2xxx: Fix race conditions in the code for aborting SCSI commands

In the *_done() functions, instead of returning early if sp->ref_count >=
2, only decrement sp->ref_count. In qla2xxx_eh_abort(), instead of deciding
what to do based on the value of sp->ref_count, decide which action to take
depending on the completion status of the firmware abort. Remove srb.cwaitq
and use srb.comp instead. In qla2x00_abort_srb(), call
isp_ops->abort_command() directly instead of calling qla2xxx_eh_abort().

Cc: Himanshu Madhani <hmadhani@marvell.com>
Cc: Giridhar Malavali <gmalavali@marvell.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Acked-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qla2xxx/qla_def.h
drivers/scsi/qla2xxx/qla_nvme.c
drivers/scsi/qla2xxx/qla_nvme.h
drivers/scsi/qla2xxx/qla_os.c