diff mbox series

[09/16] qla2xxx: Fix unintended Logout

Message ID 20180725170120.10269-10-himanshu.madhani@cavium.com (mailing list archive)
State Changes Requested
Headers show
Series qla2xxx: Updates for the driver | expand

Commit Message

Madhani, Himanshu July 25, 2018, 5:01 p.m. UTC
From: Quinn Tran <quinn.tran@cavium.com>

During normal IO, FW can return IO with 'port unavailble' status.
Driver would send a LOGO to remote port for session resync.  On
an off chance, a PLOGI could arrive before sending the LOGO.
This patch will skip sendiing LOGO, if a PLOGI just came in.

Signed-off-by: Quinn Tran <quinn.tran@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
---
 drivers/scsi/qla2xxx/qla_target.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c
index 70c98316b793..8c811b251d42 100644
--- a/drivers/scsi/qla2xxx/qla_target.c
+++ b/drivers/scsi/qla2xxx/qla_target.c
@@ -986,8 +986,9 @@  void qlt_free_session_done(struct work_struct *work)
 
 			logo.id = sess->d_id;
 			logo.cmd_count = 0;
+			if (!own)
+				qlt_send_first_logo(vha, &logo);
 			sess->send_els_logo = 0;
-			qlt_send_first_logo(vha, &logo);
 		}
 
 		if (sess->logout_on_delete && sess->loop_id != FC_NO_LOOP_ID) {