On Sun, 2016-12-18 at 01:02 -0800, Himanshu Madhani wrote: > diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c > index 6643f6f..9275f36 100644 > --- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c > +++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c > @@ -567,6 +567,30 @@ static int tcm_qla2xxx_handle_tmr(struct qla_tgt_mgmt_cmd *mcmd, uint32_t lun, > { > struct qla_tgt_sess *sess = mcmd->sess; > struct se_cmd *se_cmd = &mcmd->se_cmd; > + struct se_session *se_sess = sess->se_sess; > + bool found_lun = false; > + > + switch (tmr_func) { > + case TMR_ABORT_TASK: > + spin_lock(&se_sess->sess_cmd_lock); > + list_for_each_entry(se_cmd, &se_sess->sess_cmd_list, se_cmd_list) { > + struct qla_tgt_cmd *cmd = > + container_of(se_cmd, struct qla_tgt_cmd, se_cmd); > + struct abts_recv_from_24xx *abts = &mcmd->orig_iocb.abts; > + > + if (se_cmd->tag == abts->exchange_addr_to_abort) { > + lun = cmd->unpacked_lun; > + found_lun = true; > + break; > + } > + } > + spin_unlock(&se_sess->sess_cmd_lock); > + if (!found_lun) > + return -ENOBUFS; > + break; > + default: > + break; > + } > > return target_submit_tmr(se_cmd, sess->se_sess, NULL, lun, mcmd, > tmr_func, GFP_ATOMIC, tag, TARGET_SCF_ACK_KREF); Hello Himanshu, Please consider removing the sess_cmd_list loop. Any lookups in sess_cmd_list should be performed by the target core and not by a target driver. Are you aware that core_tmr_abort_task() performs a very similar lookup to the one above? Bart.��.n��������+%������w��{.n�����{������ܨ}���Ơz�j:+v�����w����ޙ��&�)ߡ�a����z�ޗ���ݢj��w�f