public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Christof Schmitt <christof.schmitt@de.ibm.com>
To: linux-scsi@vger.kernel.org
Subject: FC transport: Calling fc_remote_port_add for online port
Date: Fri, 26 Jun 2009 17:23:03 +0200	[thread overview]
Message-ID: <20090626152303.GA21058@schmichrtp.de.ibm.com> (raw)

When a LLD calls fc_remote_port_add for a port that is already in the
state FC_PORTSTATE_ONLINE, the FC transport class will create a new
fc_rport struct and sysfs will show two entries for the same port.

How should this be handled? Does the LLD have to track the state and
only call fc_remote_port add for new ports and ports in the state
FC_PORTSTATE_BLOCKED or FC_PORTTYPE_NOTPRESENT?

Or should the FC transport class allow that a LLD can call
fc_remote_port_add at any time? The patch does this change in the FC
transport class.

Thoughts, comments?

--
Christof Schmitt

---
 drivers/scsi/scsi_transport_fc.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

--- a/drivers/scsi/scsi_transport_fc.c	2009-06-23 14:41:20.000000000 +0200
+++ b/drivers/scsi/scsi_transport_fc.c	2009-06-23 15:22:21.000000000 +0200
@@ -2580,9 +2580,7 @@ fc_remote_port_add(struct Scsi_Host *sho
 	spin_lock_irqsave(shost->host_lock, flags);
 
 	list_for_each_entry(rport, &fc_host->rports, peers) {
-
-		if ((rport->port_state == FC_PORTSTATE_BLOCKED) &&
-			(rport->channel == channel)) {
+		if (rport->channel == channel) {
 
 			switch (fc_host->tgtid_bind_type) {
 			case FC_TGTID_BIND_BY_WWPN:

             reply	other threads:[~2009-06-26 15:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-26 15:23 Christof Schmitt [this message]
2009-06-26 16:41 ` FC transport: Calling fc_remote_port_add for online port James Smart
2009-06-29 13:52   ` Christof Schmitt

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=20090626152303.GA21058@schmichrtp.de.ibm.com \
    --to=christof.schmitt@de.ibm.com \
    --cc=linux-scsi@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox