Commit 0d81b4e8 authored by Christof Schmitt's avatar Christof Schmitt Committed by James Bottomley

[SCSI] zfcp: Add allow_lun_scan module parameter

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: default avatarSwen Schillig <swen@vnet.ibm.com>
Signed-off-by: default avatarChristof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent 51780d2c
...@@ -30,6 +30,10 @@ module_param_named(dif, enable_dif, bool, 0600); ...@@ -30,6 +30,10 @@ module_param_named(dif, enable_dif, bool, 0600);
MODULE_PARM_DESC(dif, "Enable DIF/DIX data integrity support"); MODULE_PARM_DESC(dif, "Enable DIF/DIX data integrity support");
#endif #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, static int zfcp_scsi_change_queue_depth(struct scsi_device *sdev, int depth,
int reason) int reason)
{ {
...@@ -130,6 +134,7 @@ static int zfcp_scsi_slave_alloc(struct scsi_device *sdev) ...@@ -130,6 +134,7 @@ static int zfcp_scsi_slave_alloc(struct scsi_device *sdev)
struct zfcp_scsi_dev *zfcp_sdev = sdev_to_zfcp(sdev); struct zfcp_scsi_dev *zfcp_sdev = sdev_to_zfcp(sdev);
struct zfcp_port *port; struct zfcp_port *port;
struct zfcp_unit *unit; struct zfcp_unit *unit;
int npiv = adapter->connection_features & FSF_FEATURE_NPIV_MODE;
port = zfcp_get_port_by_wwpn(adapter, rport->port_name); port = zfcp_get_port_by_wwpn(adapter, rport->port_name);
if (!port) if (!port)
...@@ -139,7 +144,7 @@ static int zfcp_scsi_slave_alloc(struct scsi_device *sdev) ...@@ -139,7 +144,7 @@ static int zfcp_scsi_slave_alloc(struct scsi_device *sdev)
if (unit) if (unit)
put_device(&unit->dev); put_device(&unit->dev);
if (!unit && !(adapter->connection_features & FSF_FEATURE_NPIV_MODE)) { if (!unit && !(allow_lun_scan && npiv)) {
put_device(&port->dev); put_device(&port->dev);
return -ENXIO; return -ENXIO;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment