summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJoe Eykholt <jeykholt@cisco.com>2009-10-21 16:28:30 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2010-01-28 15:01:38 -0800
commit407590ad18fa9f3c6561bda1caa04cdcdec9fe1f (patch)
tree48a54b76116f20cc25f8ef526279f7785e16263a /include
parenta3d46ca93e4625246a89e62c913ba60742d7bc70 (diff)
libfc: fix free of fc_rport_priv with timer pending
commit b4a9c7ede96e90f7b1ec009ce7256059295e76df upstream. Timer crashes were caused by freeing a struct fc_rport_priv with a timer pending, causing the timer facility list to be corrupted. This was during FC uplink flap tests with a lot of targets. After discovery, we were doing an PLOGI on an rdata that was in DELETE state but not yet removed from the lookup list. This moved the rdata from DELETE state to PLOGI state. If the PLOGI exchange allocation failed and needed to be retried, the timer scheduling could race with the free being done by fc_rport_work(). When fc_rport_login() is called on a rport in DELETE state, move it to a new state RESTART. In fc_rport_work, when handling a LOGO, STOPPED or FAILED event, look for restart state. In the RESTART case, don't take the rdata off the list and after the transport remote port is deleted and exchanges are reset, re-login to the remote port. Note that the new RESTART state also corrects a problem we had when re-discovering a port that had moved to DELETE state. In that case, a new rdata was created, but the old rdata would do an exchange manager reset affecting the FC_ID for both the new rdata and old rdata. With the new state, the new port isn't logged into until after any old exchanges are reset. Signed-off-by: Joe Eykholt <jeykholt@cisco.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include')
-rw-r--r--include/scsi/libfc.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index 65dc9aacbf70..09a124b9e465 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -145,6 +145,7 @@ enum fc_rport_state {
RPORT_ST_LOGO, /* port logout sent */
RPORT_ST_ADISC, /* Discover Address sent */
RPORT_ST_DELETE, /* port being deleted */
+ RPORT_ST_RESTART, /* remote port being deleted and will restart */
};
/**