From: Hannes Reinecke <hare@suse.de>
To: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>,
Johannes Thumshirn <jth@kernel.org>,
James Bottomley <james.bottomley@hansenpartnership.com>,
Chad Dupuis <chad.dupuis@cavium.com>,
linux-scsi@vger.kernel.org, Hannes Reinecke <hare@suse.de>,
Hannes Reinecke <hare@suse.com>
Subject: [PATCHv2 4/7] libfc: Do not drop down to FLOGI for fc_rport_login()
Date: Fri, 30 Sep 2016 11:01:17 +0200 [thread overview]
Message-ID: <1475226080-60365-5-git-send-email-hare@suse.de> (raw)
In-Reply-To: <1475226080-60365-1-git-send-email-hare@suse.de>
When fc_rport_login() is called while the rport is not
in RPORT_ST_INIT, RPORT_ST_READY, or RPORT_ST_DELETE
login is already in progress and there's no need to
drop down to FLOGI; doing so will only confuse the
other side.
Signed-off-by: Hannes Reinecke <hare@suse.com>
Acked-by: Johannes Thumshirn <jth@kernel.org>
---
drivers/scsi/libfc/fc_rport.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c
index ff33ae6..4e4087a 100644
--- a/drivers/scsi/libfc/fc_rport.c
+++ b/drivers/scsi/libfc/fc_rport.c
@@ -427,10 +427,14 @@ static int fc_rport_login(struct fc_rport_priv *rdata)
case RPORT_ST_DELETE:
FC_RPORT_DBG(rdata, "Restart deleted port\n");
break;
- default:
+ case RPORT_ST_INIT:
FC_RPORT_DBG(rdata, "Login to port\n");
fc_rport_enter_flogi(rdata);
break;
+ default:
+ FC_RPORT_DBG(rdata, "Login in progress, state %s\n",
+ fc_rport_state(rdata));
+ break;
}
mutex_unlock(&rdata->rp_mutex);
--
1.8.5.6
next prev parent reply other threads:[~2016-09-30 9:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-30 9:01 [PATCHv2 0/7] libfc: sanitize kref and state machine fixes Hannes Reinecke
2016-09-30 9:01 ` [PATCHv2 1/7] libfc: Revisit kref handling Hannes Reinecke
2016-09-30 9:01 ` [PATCHv2 2/7] libfc: Fixup disc_mutex handling Hannes Reinecke
2016-09-30 9:01 ` [PATCHv2 3/7] libfc: Do not take rdata->rp_mutex when processing a -FC_EX_CLOSED ELS response Hannes Reinecke
2016-09-30 9:01 ` Hannes Reinecke [this message]
2016-09-30 9:01 ` [PATCHv2 5/7] libfc: Do not login if the port is already started Hannes Reinecke
2016-09-30 9:01 ` [PATCHv2 6/7] libfc: don't advance state machine for incoming FLOGI Hannes Reinecke
2016-09-30 9:01 ` [PATCHv2 7/7] fcoe: Harden CVL handling when we have not logged into the fabric Hannes Reinecke
2016-10-11 21:07 ` [PATCHv2 0/7] libfc: sanitize kref and state machine fixes 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=1475226080-60365-5-git-send-email-hare@suse.de \
--to=hare@suse.de \
--cc=chad.dupuis@cavium.com \
--cc=hare@suse.com \
--cc=hch@lst.de \
--cc=james.bottomley@hansenpartnership.com \
--cc=jth@kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).