qla2xxx: cleanup cmd in qla workqueue before processing TMR
Since cmds go into qla_tgt_wq and TMRs don't, it's possible that TMR like TASK_ABORT can be queued over the cmd for which it was meant. To avoid this race, use a per-port list to keep track of cmds that are enqueued to qla_tgt_wq but not yet processed. When a TMR arrives, iterate through this list and remove any cmds that match the TMR. This patch supports TASK_ABORT and LUN_RESET. Cc: <stable@vger.kernel.org> # v3.18+ Signed-off-by: Swapnil Nagle <swapnil.nagle@purestorage.com> Signed-off-by: Alexei Potashnik <alexei@purestorage.com> Acked-by: Quinn Tran <quinn.tran@qlogic.com> Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
This commit is contained in:
committed by
Nicholas Bellinger
parent
b2032fd567
commit
8b2f5ff3d0
@@ -874,6 +874,8 @@ struct qla_tgt_sess_op {
|
||||
struct scsi_qla_host *vha;
|
||||
struct atio_from_isp atio;
|
||||
struct work_struct work;
|
||||
struct list_head cmd_list;
|
||||
bool aborted;
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -1076,6 +1078,16 @@ static inline void qla_reverse_ini_mode(struct scsi_qla_host *ha)
|
||||
ha->host->active_mode |= MODE_INITIATOR;
|
||||
}
|
||||
|
||||
static inline uint32_t sid_to_key(const uint8_t *s_id)
|
||||
{
|
||||
uint32_t key;
|
||||
|
||||
key = (((unsigned long)s_id[0] << 16) |
|
||||
((unsigned long)s_id[1] << 8) |
|
||||
(unsigned long)s_id[2]);
|
||||
return key;
|
||||
}
|
||||
|
||||
/*
|
||||
* Exported symbols from qla_target.c LLD logic used by qla2xxx code..
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user