Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>

authored by

Christof Schmitt and committed by
James Bottomley
0d81b4e8 51780d2c

+6 -1
+6 -1
drivers/s390/scsi/zfcp_scsi.c
··· 30 30 MODULE_PARM_DESC(dif, "Enable DIF/DIX data integrity support"); 31 31 #endif 32 32 33 + static bool allow_lun_scan = 1; 34 + module_param(allow_lun_scan, bool, 0600); 35 + MODULE_PARM_DESC(allow_lun_scan, "For NPIV, scan and attach all storage LUNs"); 36 + 33 37 static int zfcp_scsi_change_queue_depth(struct scsi_device *sdev, int depth, 34 38 int reason) 35 39 { ··· 134 130 struct zfcp_scsi_dev *zfcp_sdev = sdev_to_zfcp(sdev); 135 131 struct zfcp_port *port; 136 132 struct zfcp_unit *unit; 133 + int npiv = adapter->connection_features & FSF_FEATURE_NPIV_MODE; 137 134 138 135 port = zfcp_get_port_by_wwpn(adapter, rport->port_name); 139 136 if (!port) ··· 144 139 if (unit) 145 140 put_device(&unit->dev); 146 141 147 - if (!unit && !(adapter->connection_features & FSF_FEATURE_NPIV_MODE)) { 142 + if (!unit && !(allow_lun_scan && npiv)) { 148 143 put_device(&port->dev); 149 144 return -ENXIO; 150 145 }