All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anastasia Kovaleva <a.kovaleva@yadro.com>
To: <target-devel@vger.kernel.org>
Cc: <linux-scsi@vger.kernel.org>, <linux@yadro.com>,
	Anastasia Kovaleva <a.kovaleva@yadro.com>,
	Roman Bolshakov <r.bolshakov@yadro.com>
Subject: [PATCH] scsi: qla2xxx: Prevent PRLI in target mode
Date: Thu, 22 Apr 2021 18:34:14 +0300	[thread overview]
Message-ID: <20210422153414.4022-1-a.kovaleva@yadro.com> (raw)

In a case when the initiator in P2P mode by some circumstances do not
send PRLI, the target, in a case when the target port’s WWPN is less
than initiator’s one, changes the discovery state in DSC_GNL, and when
gnl completes, it sends PRLI to the initiator.

Usually the initiator in P2P mode always sends PRLI. We catch this issue
on Linux stable v5.4.6 https://www.spinics.net/lists/stable/msg458515.html

The change fixes this particular corner case in the behaviour of the
P2P mod target login state machine.

Fixes: a9ed06d4e640a ("scsi: qla2xxx: Allow PLOGI in target mode")
Signed-off-by: Anastasia Kovaleva <a.kovaleva@yadro.com>
Reviewed-by: Roman Bolshakov <r.bolshakov@yadro.com>
---
 drivers/scsi/qla2xxx/qla_init.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index f01f07116bd3..71f79c988fdc 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -1194,6 +1194,9 @@ static int qla24xx_post_prli_work(struct scsi_qla_host *vha, fc_port_t *fcport)
 {
 	struct qla_work_evt *e;
 
+	if (vha->host->active_mode == MODE_TARGET)
+                return QLA_FUNCTION_FAILED;
+
 	e = qla2x00_alloc_work(vha, QLA_EVT_PRLI);
 	if (!e)
 		return QLA_FUNCTION_FAILED;
-- 
2.30.2


             reply	other threads:[~2021-04-22 15:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-22 15:34 Anastasia Kovaleva [this message]
2021-04-22 17:06 ` [PATCH] scsi: qla2xxx: Prevent PRLI in target mode Himanshu Madhani
2021-04-29  3:18 ` Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210422153414.4022-1-a.kovaleva@yadro.com \
    --to=a.kovaleva@yadro.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux@yadro.com \
    --cc=r.bolshakov@yadro.com \
    --cc=target-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.