public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] 4/6: scsi_allow_ghost_devices
@ 2004-04-18 18:59 Kurt Garloff
  2004-04-18 19:20 ` Christoph Hellwig
  0 siblings, 1 reply; 8+ messages in thread
From: Kurt Garloff @ 2004-04-18 18:59 UTC (permalink / raw)
  To: Linux SCSI list; +Cc: James Bottomley, Andrew Morton

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


Feature.

scsi_allow_ghost_devices=N
This patch introduces a boot/module parameter that allows the user to tell
the kernel to NOT set the first N devices to offline despite they would
normally be. Needed for some EMC multipathing devices.
This parameter is even documented in EMC docs as both RH and SUSE had
such a parameter in their 2.4 vendor kernels :-/

--- linux-2.6.5.noreplunhost/drivers/scsi/scsi_scan.c.orig	2004-04-15 22:42:48.544207000 +0200
+++ linux-2.6.5.noreplunhost/drivers/scsi/scsi_scan.c	2004-04-15 22:51:08.291252857 +0200
@@ -119,6 +119,12 @@ module_param_named(scsi_reportlun2, scsi
 MODULE_PARM_DESC(scsi_reportlun2,
 		 "Use REPORT_LUNs for scanning SCSI-2 devs as well");
 
+static unsigned int scsi_allow_ghost_devices;
+module_param_named(scsi_allow_ghost_devices ,scsi_allow_ghost_devices, int, S_IRUGO|S_IWUSR);
+MODULE_PARM_DESC(scsi_allow_ghost_devices, 
+		 "allow devices marked as being offline to be accessed anyway "
+		 "(0 = off, else allow ghosts on lun 0 through allow_ghost_devices - 1");
+
 
 /**
  * scsi_unlock_floptical - unlock device via a special MODE SENSE command
@@ -573,7 +579,8 @@ static int scsi_add_lun(struct scsi_devi
 	 * otherwise, offline devices still get an sd allocated, and they
 	 * use up an sd slot.
 	 */
-	if (((inq_result[0] >> 5) & 7) == 1) {
+	if (((inq_result[0] >> 5) & 7) == 1 &&
+	    (sdev->lun >= scsi_allow_ghost_devices)) {
 		SCSI_LOG_SCAN_BUS(3, printk(KERN_INFO "scsi scan: peripheral"
 				" qualifier of 1, device offlined\n"));
 		sdev->online = FALSE;
-- 
Kurt Garloff  <garloff@suse.de>                            Cologne, DE 
SUSE LINUX AG, Nuernberg, DE                          SUSE Labs (Head)

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

end of thread, other threads:[~2004-04-20 17:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-18 18:59 [PATCH] 4/6: scsi_allow_ghost_devices Kurt Garloff
2004-04-18 19:20 ` Christoph Hellwig
2004-04-18 22:14   ` Kurt Garloff
2004-04-19  7:34   ` Arjan van de Ven
2004-04-19 12:06     ` Doug Ledford
2004-04-19 12:14       ` Christoph Hellwig
2004-04-19 13:34         ` Matthew Wilcox
2004-04-20 17:34           ` Patrick Mansfield

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