summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_target.c
diff options
context:
space:
mode:
authorQuinn Tran <quinn.tran@cavium.com>2018-05-01 18:01:49 +0200
committerMartin K. Petersen <martin.petersen@oracle.com>2018-05-08 06:46:11 +0200
commit8ea4faf829eb2ea36dd0c989965c029390d238f3 (patch)
treef6e043ccd2624a73d38e5a085415c484f91addb5 /drivers/scsi/qla2xxx/qla_target.c
parentscsi: qla2xxx: Move GPSC and GFPNID out of session management (diff)
downloadlinux-8ea4faf829eb2ea36dd0c989965c029390d238f3.tar.xz
linux-8ea4faf829eb2ea36dd0c989965c029390d238f3.zip
scsi: qla2xxx: Fix Inquiry command being dropped in Target mode
When a connection is established, the target core session may not be created immediately. Current code will drop/terminate the command based on the session state. This patch will return BUSY status for any commands arriving on wire before the session is created. Signed-off-by: Quinn Tran <quinn.tran@cavium.com> Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_target.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_target.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c
index 3e8bf728e884..5e81b64c8ef5 100644
--- a/drivers/scsi/qla2xxx/qla_target.c
+++ b/drivers/scsi/qla2xxx/qla_target.c
@@ -5140,10 +5140,15 @@ static int __qlt_send_busy(struct qla_qpair *qpair,
struct fc_port *sess = NULL;
unsigned long flags;
u16 temp;
+ port_id_t id;
+
+ id.b.al_pa = atio->u.isp24.fcp_hdr.s_id[2];
+ id.b.area = atio->u.isp24.fcp_hdr.s_id[1];
+ id.b.domain = atio->u.isp24.fcp_hdr.s_id[0];
+ id.b.rsvd_1 = 0;
spin_lock_irqsave(&ha->tgt.sess_lock, flags);
- sess = ha->tgt.tgt_ops->find_sess_by_s_id(vha,
- atio->u.isp24.fcp_hdr.s_id);
+ sess = qla2x00_find_fcport_by_nportid(vha, &id, 1);
spin_unlock_irqrestore(&ha->tgt.sess_lock, flags);
if (!sess) {
qlt_send_term_exchange(qpair, NULL, atio, 1, 0);