From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-sn1nam01on0111.outbound.protection.outlook.com ([104.47.32.111]:46915 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727048AbeIBRTF (ORCPT ); Sun, 2 Sep 2018 13:19:05 -0400 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Quinn Tran , Himanshu Madhani , "Martin K . Petersen" , Sasha Levin Subject: [PATCH AUTOSEL 4.18 016/131] scsi: qla2xxx: Fix unintended Logout Date: Sun, 2 Sep 2018 13:03:18 +0000 Message-ID: <20180902064601.183036-16-alexander.levin@microsoft.com> References: <20180902064601.183036-1-alexander.levin@microsoft.com> In-Reply-To: <20180902064601.183036-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Quinn Tran [ Upstream commit cb97f2c2e8d9f8c71ddbf04ad57e163ee6d86474 ] 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 Signed-off-by: Himanshu Madhani Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/qla2xxx/qla_target.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_t= arget.c index 1027b0cb7fa3..6dc1b1bd8069 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -982,8 +982,9 @@ void qlt_free_session_done(struct work_struct *work) =20 logo.id =3D sess->d_id; logo.cmd_count =3D 0; + if (!own) + qlt_send_first_logo(vha, &logo); sess->send_els_logo =3D 0; - qlt_send_first_logo(vha, &logo); } =20 if (sess->logout_on_delete && sess->loop_id !=3D FC_NO_LOOP_ID) { --=20 2.17.1