Skip to content

Commit f8210e3

Browse files
Christof SchmittJames Bottomley
Christof Schmitt
authored and
James Bottomley
committed
[SCSI] zfcp: Allow midlayer to scan for LUNs when running in NPIV mode
Enable the LUN scanning mechanism in the SCSI midlayer: - Do not set the disable_target_scan bit in the FC transport class. - Set max_lun to 0xFFFFFFFF to allow the midlayer scan to include the two-level hierachical LUNs (like 0x40XX40XX00000000, but in SCSI midlayer LUN format). - Set max_id to a high value to allow triggering the SCSI device rescan from sysfs. When running in NPIV mode, zfcp accepts all LUNs in slave_attach. When running in non-NPIV mode, the list of zfcp_unit structs determines which SCSI devices are allowed on the current system. Reviewed-by: Swen Schillig <[email protected]> Signed-off-by: Christof Schmitt <[email protected]> Signed-off-by: James Bottomley <[email protected]>
1 parent b62a8d9 commit f8210e3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/s390/scsi/zfcp_scsi.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ static int zfcp_scsi_slave_alloc(struct scsi_device *sdev)
143143
unit = zfcp_unit_find(port, zfcp_scsi_dev_lun(sdev));
144144
if (unit)
145145
put_device(&unit->dev);
146-
else {
146+
147+
if (!unit && !(adapter->connection_features & FSF_FEATURE_NPIV_MODE)) {
147148
put_device(&port->dev);
148149
return -ENXIO;
149150
}
@@ -309,8 +310,8 @@ int zfcp_adapter_scsi_register(struct zfcp_adapter *adapter)
309310
}
310311

311312
/* tell the SCSI stack some characteristics of this adapter */
312-
adapter->scsi_host->max_id = 1;
313-
adapter->scsi_host->max_lun = 1;
313+
adapter->scsi_host->max_id = 511;
314+
adapter->scsi_host->max_lun = 0xFFFFFFFF;
314315
adapter->scsi_host->max_channel = 0;
315316
adapter->scsi_host->unique_id = dev_id.devno;
316317
adapter->scsi_host->max_cmd_len = 16; /* in struct fcp_cmnd */
@@ -687,7 +688,6 @@ struct fc_function_template zfcp_transport_functions = {
687688
.show_host_port_type = 1,
688689
.show_host_speed = 1,
689690
.show_host_port_id = 1,
690-
.disable_target_scan = 1,
691691
.dd_bsg_size = sizeof(struct zfcp_fsf_ct_els),
692692
};
693693

0 commit comments

Comments
 (0)