Re: [PATCHv2] scsi: disable automatic target scan

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03/15/2016 12:28 PM, Hannes Reinecke wrote:
On 03/15/2016 12:03 PM, Steffen Maier wrote:
On 03/15/2016 08:19 AM, Hannes Reinecke wrote:
On larger installations it is useful to disable automatic LUN
scanning, and only add the required LUNs via udev rules.
This can speed up bootup dramatically.

This patch introduces a new scan module parameter value 'manual',
which works like 'none', but can be overriden by setting the 'rescan'
value from scsi_scan_target to 'SCSI_SCAN_MANUAL'.
And it updates all relevant callers to set the 'rescan' value
to 'SCSI_SCAN_MANUAL' if invoked via the 'scan' option in sysfs.

Signed-off-by: Hannes Reinecke <hare@xxxxxxx>

In particular, the following might be necessary in order not to
break zfcp manual LUN addition (as long as zfcp still has its own
unit_add sysfs interface; completely replacing it with the solution
here is not easy because it breaks the zfcp sysfs user interface):

void zfcp_unit_scsi_scan(struct zfcp_unit *unit)
{
     struct fc_rport *rport = unit->port->rport;
     u64 lun;

     lun = scsilun_to_int((struct scsi_lun *) &unit->fcp_lun);

     if (rport && rport->port_state == FC_PORTSTATE_ONLINE)
-         scsi_scan_target(&rport->dev, 0, rport->scsi_target_id,
lun, 1);
+         scsi_scan_target(&rport->dev, 0, rport->scsi_target_id,
lun,
+                  SCSI_SCAN_MANUAL);
}

As for zfcp: it also relies on the 'user_scan' callback from
scsi_transport_fc, so it will fall under the same rules as any
'normal' FC HBA.

I'm not sure, since zfcp needs to continue to support HBA hardware virtualization without NPIV.

The zfcp unit_add sysfs interface is kind of a peer of your common code scsi scan interface interface. I think, for zfcp users, a unit_add needs to be sufficient. It would be strange to additionally have them also write the same LUN into the Scsi_Host's scan sysfs attribute, i.e. having to double configure things.

But I do think we can tie the 'scan' module parameter with the
'allow_lun_scan' parameter from zfcp; both are now doing essentially
the same. Eg the 'allow_lun_scan' parameter could take it's default
value from the 'scan' parameter.

In the long run we might want to check if and how the global 'scan'
parameter can be moved down to a host parameter, which then would
eliminate the need for a zfcp-specific parameter.

I need to think about this.

--
Mit freundlichen Grüßen / Kind regards
Steffen Maier

Linux on z Systems Development

IBM Deutschland Research & Development GmbH
Vorsitzende des Aufsichtsrats: Martina Koederitz
Geschaeftsfuehrung: Dirk Wittkopp
Sitz der Gesellschaft: Boeblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux