linux-s390.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 0/1] Another zfcp fix for 2.6.37-rc
@ 2010-12-08 16:30 Christof Schmitt
  2010-12-08 16:30 ` [patch 1/1] zfcp: Add allow_lun_scan module parameter Christof Schmitt
  0 siblings, 1 reply; 2+ messages in thread
From: Christof Schmitt @ 2010-12-08 16:30 UTC (permalink / raw)
  To: James Bottomley; +Cc: linux-scsi, linux-s390, schwidefsky, heiko.carstens

James,

i know this is late, but if there will be another merge of scsi fixes
for the 2.6.37-rc cycle, i would like to have this patch included on
top of the previously sent fixes.

The REPORT LUNS scan from the SCSI midlayer works well after we
enabled it with the zfcp changes in 2.6.37-rc1. But we discovered that
we need a way to disable the LUN scan for the zfcpdump userspace tool.
The zfcpdump tool runs in a restricted environment and there is not
enough memory to attach SCSI devices for a large SAN fabric.

Introducing a new zfcp module parameter that is set for zfcpdump is
the best solution to have the REPORT LUNS scan by default and allow to
disable it from zfcpdump.

--
Christof

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

* [patch 1/1] zfcp: Add allow_lun_scan module parameter
  2010-12-08 16:30 [patch 0/1] Another zfcp fix for 2.6.37-rc Christof Schmitt
@ 2010-12-08 16:30 ` Christof Schmitt
  0 siblings, 0 replies; 2+ messages in thread
From: Christof Schmitt @ 2010-12-08 16:30 UTC (permalink / raw)
  To: James Bottomley
  Cc: linux-scsi, linux-s390, schwidefsky, heiko.carstens,
	Christof Schmitt

[-- Attachment #1: param.diff --]
[-- Type: text/plain, Size: 1565 bytes --]

From: Christof Schmitt <christof.schmitt@de.ibm.com>

The zfcpdump tool requires a method to attach exactly one LUN. The
easiest way to achieve this is to add a new zfcp module parameter.
When allow_lun_scan is set to "false", zfcp only accepts LUNs that
have been configured through the unit_add sysfs interface.

Reviewed-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
---
 drivers/s390/scsi/zfcp_scsi.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

--- a/drivers/s390/scsi/zfcp_scsi.c
+++ b/drivers/s390/scsi/zfcp_scsi.c
@@ -30,6 +30,10 @@ module_param_named(dif, enable_dif, bool
 MODULE_PARM_DESC(dif, "Enable DIF/DIX data integrity support");
 #endif
 
+static bool allow_lun_scan = 1;
+module_param(allow_lun_scan, bool, 0600);
+MODULE_PARM_DESC(allow_lun_scan, "For NPIV, scan and attach all storage LUNs");
+
 static int zfcp_scsi_change_queue_depth(struct scsi_device *sdev, int depth,
 					int reason)
 {
@@ -134,6 +138,7 @@ static int zfcp_scsi_slave_alloc(struct
 	struct zfcp_scsi_dev *zfcp_sdev = sdev_to_zfcp(sdev);
 	struct zfcp_port *port;
 	struct zfcp_unit *unit;
+	int npiv = adapter->connection_features & FSF_FEATURE_NPIV_MODE;
 
 	port = zfcp_get_port_by_wwpn(adapter, rport->port_name);
 	if (!port)
@@ -143,7 +148,7 @@ static int zfcp_scsi_slave_alloc(struct
 	if (unit)
 		put_device(&unit->dev);
 
-	if (!unit && !(adapter->connection_features & FSF_FEATURE_NPIV_MODE)) {
+	if (!unit && !(allow_lun_scan && npiv)) {
 		put_device(&port->dev);
 		return -ENXIO;
 	}

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

end of thread, other threads:[~2010-12-08 16:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-08 16:30 [patch 0/1] Another zfcp fix for 2.6.37-rc Christof Schmitt
2010-12-08 16:30 ` [patch 1/1] zfcp: Add allow_lun_scan module parameter Christof Schmitt

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).