public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] make fc transport removal of target configurable
@ 2006-06-12 23:16 Michael Reed
  2006-06-13  7:07 ` Christoph Hellwig
  0 siblings, 1 reply; 18+ messages in thread
From: Michael Reed @ 2006-06-12 23:16 UTC (permalink / raw)
  To: linux-scsi
  Cc: James.Smart, Jim Nead, Jeremy Higdon, Michael Reed, Gary Hagensen

[-- Attachment #1: Type: text/plain, Size: 377 bytes --]

If the fc transport removes the scsi infrastructure for a
disconnected target and that target subsequently returns,
those subsystems layered upon scsi which don't understand
the implications of this disconnection / reconnection may
be unable to access the reconnected scsi target.  This patch
makes the target removal configurable.

Signed-off-by: Michael Reed <mdr@sgi.com>



[-- Attachment #2: fc_transport_optional_remove.patch --]
[-- Type: text/x-patch, Size: 2209 bytes --]

--- rc6u/drivers/scsi/scsi_transport_fc.c	2006-06-07 12:21:31.000000000 -0500
+++ rc6/drivers/scsi/scsi_transport_fc.c	2006-06-12 17:23:34.135974222 -0500
@@ -374,9 +374,29 @@
 MODULE_PARM_DESC(dev_loss_tmo,
 		 "Maximum number of seconds that the FC transport should"
 		 " insulate the loss of a remote port. Once this value is"
-		 " exceeded, the scsi target is removed. Value should be"
+		 " exceeded, the scsi target may be removed. Reference the
+		 " remove_on_dev_loss module parameter.  Value should be"
 		 " between 1 and SCSI_DEVICE_BLOCK_MAX_TIMEOUT.");
 
+/*
+ * remove_on_dev_loss: controls whether the transport will
+ *   remove a scsi target after the device loss timer expires.
+ *   Removal on disconnect is modeled after the USB subsystem
+ *   and expects subsystems layered on SCSI to be aware of
+ *   potential device loss and handle it appropriately. However,
+ *   many subsystems do not support device removal, leaving situations
+ *   where structure references may remain, causing new device
+ *   name assignments, etc., if the target returns.
+ */
+static unsigned int fc_remove_on_dev_loss = 0;
+module_param_named(remove_on_dev_loss, fc_remove_on_dev_loss,
+		   int, S_IRUGO|S_IWUSR);
+MODULE_PARM_DESC(remove_on_dev_loss,
+    		"Boolean.  When the device loss timer fires, this variable"
+		" controls whether the scsi infrastructure for the target"
+		" device is removed.  Values: zero means do not remove,"
+		" non-zero means remove.  Default is zero.");
+
 
 static __init int fc_transport_init(void)
 {
@@ -1446,7 +1466,8 @@
 	}
 	spin_unlock_irqrestore(shost->host_lock, flags);
 
-	scsi_remove_target(&rport->dev);
+	if (fc_remove_on_dev_loss)
+		scsi_remove_target(&rport->dev);
 }
 
 
@@ -1992,9 +2013,13 @@
 		return;
 	}
 
-	dev_printk(KERN_ERR, &rport->dev,
-		"blocked FC remote port time out: removing target and "
-		"saving binding\n");
+	if (fc_remove_on_dev_loss)
+		dev_printk(KERN_ERR, &rport->dev,
+			"blocked FC remote port time out: removing target and "
+			"saving binding\n");
+	else
+		dev_printk(KERN_ERR, &rport->dev,
+			"blocked FC remote port time out: saving binding\n");
 
 	list_move_tail(&rport->peers, &fc_host->rport_bindings);
 

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2006-06-15  9:07 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-12 23:16 [PATCH] make fc transport removal of target configurable Michael Reed
2006-06-13  7:07 ` Christoph Hellwig
2006-06-13 11:06   ` James Smart
2006-06-13 15:42     ` Michael Reed
2006-06-13 17:24       ` Stefan Richter
2006-06-13 19:36         ` Michael Reed
2006-06-13 23:13           ` Stefan Richter
2006-06-13 17:33       ` Steve Byan
2006-06-13 19:35         ` Michael Reed
2006-06-13 19:49           ` Steve Byan
2006-06-13 17:59       ` James Bottomley
2006-06-13 19:37         ` Michael Reed
2006-06-13 20:02           ` James Bottomley
2006-06-13 21:44             ` Michael Reed
2006-06-14  7:21               ` Hannes Reinecke
2006-06-14 16:18                 ` Mike Christie
2006-06-14 16:31             ` Mike Christie
2006-06-15  9:04               ` Stefan Richter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox