All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHv3] scsi: disable automatic target scan
@ 2016-03-17  7:39 Hannes Reinecke
  2016-03-18 19:39 ` Ewan D. Milne
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Hannes Reinecke @ 2016-03-17  7:39 UTC (permalink / raw)
  To: Martin K. Petersen
  Cc: Christoph Hellwig, James Bottomley, linux-scsi, Hannes Reinecke

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@suse.de>
---
 drivers/infiniband/ulp/srp/ib_srp.c |  2 +-
 drivers/message/fusion/mptspi.c     |  2 +-
 drivers/s390/scsi/zfcp_unit.c       |  3 ++-
 drivers/scsi/scsi_priv.h            |  2 +-
 drivers/scsi/scsi_proc.c            |  3 ++-
 drivers/scsi/scsi_scan.c            | 44 +++++++++++++++++++++++++------------
 drivers/scsi/scsi_sysfs.c           |  3 ++-
 drivers/scsi/scsi_transport_fc.c    |  6 +++--
 drivers/scsi/scsi_transport_iscsi.c |  5 ++++-
 drivers/scsi/scsi_transport_sas.c   |  7 +++---
 drivers/scsi/snic/snic_disc.c       |  2 +-
 include/scsi/scsi_device.h          |  9 +++++++-
 12 files changed, 60 insertions(+), 28 deletions(-)

diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
index 03022f6..1f97381 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -2851,7 +2851,7 @@ static int srp_add_target(struct srp_host *host, struct srp_target_port *target)
 	spin_unlock(&host->target_lock);
 
 	scsi_scan_target(&target->scsi_host->shost_gendev,
-			 0, target->scsi_id, SCAN_WILD_CARD, 0);
+			 0, target->scsi_id, SCAN_WILD_CARD, SCSI_SCAN_INITIAL);
 
 	if (srp_connected_ch(target) < target->ch_count ||
 	    target->qp_in_error) {
diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c
index 613231c..031e088 100644
--- a/drivers/message/fusion/mptspi.c
+++ b/drivers/message/fusion/mptspi.c
@@ -1150,7 +1150,7 @@ static void mpt_work_wrapper(struct work_struct *work)
 	}
 	shost_printk(KERN_INFO, shost, MYIOC_s_FMT
 	    "Integrated RAID detects new device %d\n", ioc->name, disk);
-	scsi_scan_target(&ioc->sh->shost_gendev, 1, disk, 0, 1);
+	scsi_scan_target(&ioc->sh->shost_gendev, 1, disk, 0, SCSI_SCAN_RESCAN);
 }
 
 
diff --git a/drivers/s390/scsi/zfcp_unit.c b/drivers/s390/scsi/zfcp_unit.c
index 157d3d2..08bba7c 100644
--- a/drivers/s390/scsi/zfcp_unit.c
+++ b/drivers/s390/scsi/zfcp_unit.c
@@ -26,7 +26,8 @@ void zfcp_unit_scsi_scan(struct zfcp_unit *unit)
 	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_RESCAN);
 }
 
 static void zfcp_unit_scsi_scan_work(struct work_struct *work)
diff --git a/drivers/scsi/scsi_priv.h b/drivers/scsi/scsi_priv.h
index 27b4d0a..57a4b99 100644
--- a/drivers/scsi/scsi_priv.h
+++ b/drivers/scsi/scsi_priv.h
@@ -116,7 +116,7 @@ extern void scsi_exit_procfs(void);
 extern char scsi_scan_type[];
 extern int scsi_complete_async_scans(void);
 extern int scsi_scan_host_selected(struct Scsi_Host *, unsigned int,
-				   unsigned int, u64, int);
+				   unsigned int, u64, enum scsi_scan_mode);
 extern void scsi_forget_host(struct Scsi_Host *);
 extern void scsi_rescan_device(struct device *);
 
diff --git a/drivers/scsi/scsi_proc.c b/drivers/scsi/scsi_proc.c
index 251598e..7a74b82 100644
--- a/drivers/scsi/scsi_proc.c
+++ b/drivers/scsi/scsi_proc.c
@@ -251,7 +251,8 @@ static int scsi_add_single_device(uint host, uint channel, uint id, uint lun)
 	if (shost->transportt->user_scan)
 		error = shost->transportt->user_scan(shost, channel, id, lun);
 	else
-		error = scsi_scan_host_selected(shost, channel, id, lun, 1);
+		error = scsi_scan_host_selected(shost, channel, id, lun,
+						SCSI_SCAN_MANUAL);
 	scsi_host_put(shost);
 	return error;
 }
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 97074c9..6c8ad36 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -96,10 +96,13 @@ MODULE_PARM_DESC(max_luns,
 #define SCSI_SCAN_TYPE_DEFAULT "sync"
 #endif
 
-char scsi_scan_type[6] = SCSI_SCAN_TYPE_DEFAULT;
+char scsi_scan_type[7] = SCSI_SCAN_TYPE_DEFAULT;
 
-module_param_string(scan, scsi_scan_type, sizeof(scsi_scan_type), S_IRUGO);
-MODULE_PARM_DESC(scan, "sync, async or none");
+module_param_string(scan, scsi_scan_type, sizeof(scsi_scan_type),
+		    S_IRUGO|S_IWUSR);
+MODULE_PARM_DESC(scan, "sync, async, manual, or none. "
+		 "Setting to 'manual' disables automatic scanning, but allows "
+		 "for manual device scan via the 'scan' sysfs attribute.");
 
 static unsigned int scsi_inq_timeout = SCSI_TIMEOUT/HZ + 18;
 
@@ -1040,7 +1043,8 @@ static unsigned char *scsi_inq_str(unsigned char *buf, unsigned char *inq,
  * @lun:	LUN of target device
  * @bflagsp:	store bflags here if not NULL
  * @sdevp:	probe the LUN corresponding to this scsi_device
- * @rescan:     if nonzero skip some code only needed on first scan
+ * @rescan:     if not equal to SCSI_SCAN_INITIAL skip some code only
+ *              needed on first scan
  * @hostdata:	passed to scsi_alloc_sdev()
  *
  * Description:
@@ -1055,7 +1059,8 @@ static unsigned char *scsi_inq_str(unsigned char *buf, unsigned char *inq,
  **/
 static int scsi_probe_and_add_lun(struct scsi_target *starget,
 				  u64 lun, int *bflagsp,
-				  struct scsi_device **sdevp, int rescan,
+				  struct scsi_device **sdevp,
+				  enum scsi_scan_mode rescan,
 				  void *hostdata)
 {
 	struct scsi_device *sdev;
@@ -1069,7 +1074,7 @@ static int scsi_probe_and_add_lun(struct scsi_target *starget,
 	 */
 	sdev = scsi_device_lookup_by_target(starget, lun);
 	if (sdev) {
-		if (rescan || !scsi_device_created(sdev)) {
+		if (rescan != SCSI_SCAN_INITIAL || !scsi_device_created(sdev)) {
 			SCSI_LOG_SCAN_BUS(3, sdev_printk(KERN_INFO, sdev,
 				"scsi scan: device exists on %s\n",
 				dev_name(&sdev->sdev_gendev)));
@@ -1205,7 +1210,8 @@ static int scsi_probe_and_add_lun(struct scsi_target *starget,
  *     Modifies sdevscan->lun.
  **/
 static void scsi_sequential_lun_scan(struct scsi_target *starget,
-				     int bflags, int scsi_level, int rescan)
+				     int bflags, int scsi_level,
+				     enum scsi_scan_mode rescan)
 {
 	uint max_dev_lun;
 	u64 sparse_lun, lun;
@@ -1300,7 +1306,7 @@ static void scsi_sequential_lun_scan(struct scsi_target *starget,
  *     1: could not scan with REPORT LUN
  **/
 static int scsi_report_lun_scan(struct scsi_target *starget, int bflags,
-				int rescan)
+				enum scsi_scan_mode rescan)
 {
 	char devname[64];
 	unsigned char scsi_cmd[MAX_COMMAND_SIZE];
@@ -1546,7 +1552,7 @@ void scsi_rescan_device(struct device *dev)
 EXPORT_SYMBOL(scsi_rescan_device);
 
 static void __scsi_scan_target(struct device *parent, unsigned int channel,
-		unsigned int id, u64 lun, int rescan)
+		unsigned int id, u64 lun, enum scsi_scan_mode rescan)
 {
 	struct Scsi_Host *shost = dev_to_shost(parent);
 	int bflags = 0;
@@ -1604,7 +1610,10 @@ static void __scsi_scan_target(struct device *parent, unsigned int channel,
  * @channel:	channel to scan
  * @id:		target id to scan
  * @lun:	Specific LUN to scan or SCAN_WILD_CARD
- * @rescan:	passed to LUN scanning routines
+ * @rescan:	passed to LUN scanning routines; SCSI_SCAN_INITIAL for
+ *              no rescan, SCSI_SCAN_RESCAN to rescan existing LUNs,
+ *              and SCSI_SCAN_MANUAL to force scanning even if
+ *              'scan=manual' is set.
  *
  * Description:
  *     Scan the target id on @parent, @channel, and @id. Scan at least LUN 0,
@@ -1614,13 +1623,17 @@ static void __scsi_scan_target(struct device *parent, unsigned int channel,
  *     sequential scan of LUNs on the target id.
  **/
 void scsi_scan_target(struct device *parent, unsigned int channel,
-		      unsigned int id, u64 lun, int rescan)
+		      unsigned int id, u64 lun, enum scsi_scan_mode rescan)
 {
 	struct Scsi_Host *shost = dev_to_shost(parent);
 
 	if (strncmp(scsi_scan_type, "none", 4) == 0)
 		return;
 
+	if (rescan != SCSI_SCAN_MANUAL &&
+	    strncmp(scsi_scan_type, "manual", 6) == 0)
+		return;
+
 	mutex_lock(&shost->scan_mutex);
 	if (!shost->async_scan)
 		scsi_complete_async_scans();
@@ -1634,7 +1647,8 @@ void scsi_scan_target(struct device *parent, unsigned int channel,
 EXPORT_SYMBOL(scsi_scan_target);
 
 static void scsi_scan_channel(struct Scsi_Host *shost, unsigned int channel,
-			      unsigned int id, u64 lun, int rescan)
+			      unsigned int id, u64 lun,
+			      enum scsi_scan_mode rescan)
 {
 	uint order_id;
 
@@ -1665,7 +1679,8 @@ static void scsi_scan_channel(struct Scsi_Host *shost, unsigned int channel,
 }
 
 int scsi_scan_host_selected(struct Scsi_Host *shost, unsigned int channel,
-			    unsigned int id, u64 lun, int rescan)
+			    unsigned int id, u64 lun,
+			    enum scsi_scan_mode rescan)
 {
 	SCSI_LOG_SCAN_BUS(3, shost_printk (KERN_INFO, shost,
 		"%s: <%u:%u:%llu>\n",
@@ -1844,7 +1859,8 @@ void scsi_scan_host(struct Scsi_Host *shost)
 {
 	struct async_scan_data *data;
 
-	if (strncmp(scsi_scan_type, "none", 4) == 0)
+	if (strncmp(scsi_scan_type, "none", 4) == 0 ||
+	    strncmp(scsi_scan_type, "manual", 6) == 0)
 		return;
 	if (scsi_autopm_get_host(shost) < 0)
 		return;
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
index 92ffd24..3b2045f 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -143,7 +143,8 @@ static int scsi_scan(struct Scsi_Host *shost, const char *str)
 	if (shost->transportt->user_scan)
 		res = shost->transportt->user_scan(shost, channel, id, lun);
 	else
-		res = scsi_scan_host_selected(shost, channel, id, lun, 1);
+		res = scsi_scan_host_selected(shost, channel, id, lun,
+					      SCSI_SCAN_MANUAL);
 	return res;
 }
 
diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c
index 8a88226..bf28c68 100644
--- a/drivers/scsi/scsi_transport_fc.c
+++ b/drivers/scsi/scsi_transport_fc.c
@@ -2110,7 +2110,8 @@ fc_user_scan_tgt(struct Scsi_Host *shost, uint channel, uint id, u64 lun)
 		if ((channel == rport->channel) &&
 		    (id == rport->scsi_target_id)) {
 			spin_unlock_irqrestore(shost->host_lock, flags);
-			scsi_scan_target(&rport->dev, channel, id, lun, 1);
+			scsi_scan_target(&rport->dev, channel, id, lun,
+					 SCSI_SCAN_MANUAL);
 			return;
 		}
 	}
@@ -3277,7 +3278,8 @@ fc_scsi_scan_rport(struct work_struct *work)
 	    (rport->roles & FC_PORT_ROLE_FCP_TARGET) &&
 	    !(i->f->disable_target_scan)) {
 		scsi_scan_target(&rport->dev, rport->channel,
-			rport->scsi_target_id, SCAN_WILD_CARD, 1);
+				 rport->scsi_target_id, SCAN_WILD_CARD,
+				 SCSI_SCAN_RESCAN);
 	}
 
 	spin_lock_irqsave(shost->host_lock, flags);
diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
index 4414816..7a759a9 100644
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -1783,6 +1783,7 @@ struct iscsi_scan_data {
 	unsigned int channel;
 	unsigned int id;
 	u64 lun;
+	enum scsi_scan_mode rescan;
 };
 
 static int iscsi_user_scan_session(struct device *dev, void *data)
@@ -1819,7 +1820,7 @@ static int iscsi_user_scan_session(struct device *dev, void *data)
 		    (scan_data->id == SCAN_WILD_CARD ||
 		     scan_data->id == id))
 			scsi_scan_target(&session->dev, 0, id,
-					 scan_data->lun, 1);
+					 scan_data->lun, scan_data->rescan);
 	}
 
 user_scan_exit:
@@ -1836,6 +1837,7 @@ static int iscsi_user_scan(struct Scsi_Host *shost, uint channel,
 	scan_data.channel = channel;
 	scan_data.id = id;
 	scan_data.lun = lun;
+	scan_data.rescan = SCSI_SCAN_MANUAL;
 
 	return device_for_each_child(&shost->shost_gendev, &scan_data,
 				     iscsi_user_scan_session);
@@ -1852,6 +1854,7 @@ static void iscsi_scan_session(struct work_struct *work)
 	scan_data.channel = 0;
 	scan_data.id = SCAN_WILD_CARD;
 	scan_data.lun = SCAN_WILD_CARD;
+	scan_data.rescan = SCSI_SCAN_RESCAN;
 
 	iscsi_user_scan_session(&session->dev, &scan_data);
 	atomic_dec(&ihost->nr_scans);
diff --git a/drivers/scsi/scsi_transport_sas.c b/drivers/scsi/scsi_transport_sas.c
index b6f958193..3f0ff07 100644
--- a/drivers/scsi/scsi_transport_sas.c
+++ b/drivers/scsi/scsi_transport_sas.c
@@ -1614,7 +1614,8 @@ int sas_rphy_add(struct sas_rphy *rphy)
 		else
 			lun = 0;
 
-		scsi_scan_target(&rphy->dev, 0, rphy->scsi_target_id, lun, 0);
+		scsi_scan_target(&rphy->dev, 0, rphy->scsi_target_id, lun,
+				 SCSI_SCAN_INITIAL);
 	}
 
 	return 0;
@@ -1739,8 +1740,8 @@ static int sas_user_scan(struct Scsi_Host *shost, uint channel,
 
 		if ((channel == SCAN_WILD_CARD || channel == 0) &&
 		    (id == SCAN_WILD_CARD || id == rphy->scsi_target_id)) {
-			scsi_scan_target(&rphy->dev, 0,
-					 rphy->scsi_target_id, lun, 1);
+			scsi_scan_target(&rphy->dev, 0, rphy->scsi_target_id,
+					 lun, SCSI_SCAN_MANUAL);
 		}
 	}
 	mutex_unlock(&sas_host->lock);
diff --git a/drivers/scsi/snic/snic_disc.c b/drivers/scsi/snic/snic_disc.c
index 5f63217..5f48795 100644
--- a/drivers/scsi/snic/snic_disc.c
+++ b/drivers/scsi/snic/snic_disc.c
@@ -171,7 +171,7 @@ snic_scsi_scan_tgt(struct work_struct *work)
 			 tgt->channel,
 			 tgt->scsi_tgt_id,
 			 SCAN_WILD_CARD,
-			 1);
+			 SCSI_SCAN_RESCAN);
 
 	spin_lock_irqsave(shost->host_lock, flags);
 	tgt->flags &= ~SNIC_TGT_SCAN_PENDING;
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index c067019..61341d3 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -50,6 +50,12 @@ enum scsi_device_state {
 	SDEV_CREATED_BLOCK,	/* same as above but for created devices */
 };
 
+enum scsi_scan_mode {
+	SCSI_SCAN_INITIAL = 0,
+	SCSI_SCAN_RESCAN,
+	SCSI_SCAN_MANUAL,
+};
+
 enum scsi_device_event {
 	SDEV_EVT_MEDIA_CHANGE	= 1,	/* media has changed */
 	SDEV_EVT_INQUIRY_CHANGE_REPORTED,		/* 3F 03  UA reported */
@@ -391,7 +397,8 @@ extern void scsi_device_resume(struct scsi_device *sdev);
 extern void scsi_target_quiesce(struct scsi_target *);
 extern void scsi_target_resume(struct scsi_target *);
 extern void scsi_scan_target(struct device *parent, unsigned int channel,
-			     unsigned int id, u64 lun, int rescan);
+			     unsigned int id, u64 lun,
+			     enum scsi_scan_mode rescan);
 extern void scsi_target_reap(struct scsi_target *);
 extern void scsi_target_block(struct device *);
 extern void scsi_target_unblock(struct device *, enum scsi_device_state);
-- 
1.8.5.6


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

* Re: [PATCHv3] scsi: disable automatic target scan
  2016-03-17  7:39 [PATCHv3] scsi: disable automatic target scan Hannes Reinecke
@ 2016-03-18 19:39 ` Ewan D. Milne
  2016-03-18 21:56 ` Bart Van Assche
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 14+ messages in thread
From: Ewan D. Milne @ 2016-03-18 19:39 UTC (permalink / raw)
  To: Hannes Reinecke
  Cc: Martin K. Petersen, Christoph Hellwig, James Bottomley, linux-scsi

On Thu, 2016-03-17 at 08:39 +0100, 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@suse.de>
> ---
>  drivers/infiniband/ulp/srp/ib_srp.c |  2 +-
>  drivers/message/fusion/mptspi.c     |  2 +-
>  drivers/s390/scsi/zfcp_unit.c       |  3 ++-
>  drivers/scsi/scsi_priv.h            |  2 +-
>  drivers/scsi/scsi_proc.c            |  3 ++-
>  drivers/scsi/scsi_scan.c            | 44 +++++++++++++++++++++++++------------
>  drivers/scsi/scsi_sysfs.c           |  3 ++-
>  drivers/scsi/scsi_transport_fc.c    |  6 +++--
>  drivers/scsi/scsi_transport_iscsi.c |  5 ++++-
>  drivers/scsi/scsi_transport_sas.c   |  7 +++---
>  drivers/scsi/snic/snic_disc.c       |  2 +-
>  include/scsi/scsi_device.h          |  9 +++++++-
>  12 files changed, 60 insertions(+), 28 deletions(-)
> 
> diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
> index 03022f6..1f97381 100644
> --- a/drivers/infiniband/ulp/srp/ib_srp.c
> +++ b/drivers/infiniband/ulp/srp/ib_srp.c
> @@ -2851,7 +2851,7 @@ static int srp_add_target(struct srp_host *host, struct srp_target_port *target)
>  	spin_unlock(&host->target_lock);
>  
>  	scsi_scan_target(&target->scsi_host->shost_gendev,
> -			 0, target->scsi_id, SCAN_WILD_CARD, 0);
> +			 0, target->scsi_id, SCAN_WILD_CARD, SCSI_SCAN_INITIAL);
>  
>  	if (srp_connected_ch(target) < target->ch_count ||
>  	    target->qp_in_error) {
> diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c
> index 613231c..031e088 100644
> --- a/drivers/message/fusion/mptspi.c
> +++ b/drivers/message/fusion/mptspi.c
> @@ -1150,7 +1150,7 @@ static void mpt_work_wrapper(struct work_struct *work)
>  	}
>  	shost_printk(KERN_INFO, shost, MYIOC_s_FMT
>  	    "Integrated RAID detects new device %d\n", ioc->name, disk);
> -	scsi_scan_target(&ioc->sh->shost_gendev, 1, disk, 0, 1);
> +	scsi_scan_target(&ioc->sh->shost_gendev, 1, disk, 0, SCSI_SCAN_RESCAN);
>  }
>  
> 
> diff --git a/drivers/s390/scsi/zfcp_unit.c b/drivers/s390/scsi/zfcp_unit.c
> index 157d3d2..08bba7c 100644
> --- a/drivers/s390/scsi/zfcp_unit.c
> +++ b/drivers/s390/scsi/zfcp_unit.c
> @@ -26,7 +26,8 @@ void zfcp_unit_scsi_scan(struct zfcp_unit *unit)
>  	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_RESCAN);
>  }
>  
>  static void zfcp_unit_scsi_scan_work(struct work_struct *work)
> diff --git a/drivers/scsi/scsi_priv.h b/drivers/scsi/scsi_priv.h
> index 27b4d0a..57a4b99 100644
> --- a/drivers/scsi/scsi_priv.h
> +++ b/drivers/scsi/scsi_priv.h
> @@ -116,7 +116,7 @@ extern void scsi_exit_procfs(void);
>  extern char scsi_scan_type[];
>  extern int scsi_complete_async_scans(void);
>  extern int scsi_scan_host_selected(struct Scsi_Host *, unsigned int,
> -				   unsigned int, u64, int);
> +				   unsigned int, u64, enum scsi_scan_mode);
>  extern void scsi_forget_host(struct Scsi_Host *);
>  extern void scsi_rescan_device(struct device *);
>  
> diff --git a/drivers/scsi/scsi_proc.c b/drivers/scsi/scsi_proc.c
> index 251598e..7a74b82 100644
> --- a/drivers/scsi/scsi_proc.c
> +++ b/drivers/scsi/scsi_proc.c
> @@ -251,7 +251,8 @@ static int scsi_add_single_device(uint host, uint channel, uint id, uint lun)
>  	if (shost->transportt->user_scan)
>  		error = shost->transportt->user_scan(shost, channel, id, lun);
>  	else
> -		error = scsi_scan_host_selected(shost, channel, id, lun, 1);
> +		error = scsi_scan_host_selected(shost, channel, id, lun,
> +						SCSI_SCAN_MANUAL);
>  	scsi_host_put(shost);
>  	return error;
>  }
> diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
> index 97074c9..6c8ad36 100644
> --- a/drivers/scsi/scsi_scan.c
> +++ b/drivers/scsi/scsi_scan.c
> @@ -96,10 +96,13 @@ MODULE_PARM_DESC(max_luns,
>  #define SCSI_SCAN_TYPE_DEFAULT "sync"
>  #endif
>  
> -char scsi_scan_type[6] = SCSI_SCAN_TYPE_DEFAULT;
> +char scsi_scan_type[7] = SCSI_SCAN_TYPE_DEFAULT;
>  
> -module_param_string(scan, scsi_scan_type, sizeof(scsi_scan_type), S_IRUGO);
> -MODULE_PARM_DESC(scan, "sync, async or none");
> +module_param_string(scan, scsi_scan_type, sizeof(scsi_scan_type),
> +		    S_IRUGO|S_IWUSR);
> +MODULE_PARM_DESC(scan, "sync, async, manual, or none. "
> +		 "Setting to 'manual' disables automatic scanning, but allows "
> +		 "for manual device scan via the 'scan' sysfs attribute.");
>  
>  static unsigned int scsi_inq_timeout = SCSI_TIMEOUT/HZ + 18;
>  
> @@ -1040,7 +1043,8 @@ static unsigned char *scsi_inq_str(unsigned char *buf, unsigned char *inq,
>   * @lun:	LUN of target device
>   * @bflagsp:	store bflags here if not NULL
>   * @sdevp:	probe the LUN corresponding to this scsi_device
> - * @rescan:     if nonzero skip some code only needed on first scan
> + * @rescan:     if not equal to SCSI_SCAN_INITIAL skip some code only
> + *              needed on first scan
>   * @hostdata:	passed to scsi_alloc_sdev()
>   *
>   * Description:
> @@ -1055,7 +1059,8 @@ static unsigned char *scsi_inq_str(unsigned char *buf, unsigned char *inq,
>   **/
>  static int scsi_probe_and_add_lun(struct scsi_target *starget,
>  				  u64 lun, int *bflagsp,
> -				  struct scsi_device **sdevp, int rescan,
> +				  struct scsi_device **sdevp,
> +				  enum scsi_scan_mode rescan,
>  				  void *hostdata)
>  {
>  	struct scsi_device *sdev;
> @@ -1069,7 +1074,7 @@ static int scsi_probe_and_add_lun(struct scsi_target *starget,
>  	 */
>  	sdev = scsi_device_lookup_by_target(starget, lun);
>  	if (sdev) {
> -		if (rescan || !scsi_device_created(sdev)) {
> +		if (rescan != SCSI_SCAN_INITIAL || !scsi_device_created(sdev)) {
>  			SCSI_LOG_SCAN_BUS(3, sdev_printk(KERN_INFO, sdev,
>  				"scsi scan: device exists on %s\n",
>  				dev_name(&sdev->sdev_gendev)));
> @@ -1205,7 +1210,8 @@ static int scsi_probe_and_add_lun(struct scsi_target *starget,
>   *     Modifies sdevscan->lun.
>   **/
>  static void scsi_sequential_lun_scan(struct scsi_target *starget,
> -				     int bflags, int scsi_level, int rescan)
> +				     int bflags, int scsi_level,
> +				     enum scsi_scan_mode rescan)
>  {
>  	uint max_dev_lun;
>  	u64 sparse_lun, lun;
> @@ -1300,7 +1306,7 @@ static void scsi_sequential_lun_scan(struct scsi_target *starget,
>   *     1: could not scan with REPORT LUN
>   **/
>  static int scsi_report_lun_scan(struct scsi_target *starget, int bflags,
> -				int rescan)
> +				enum scsi_scan_mode rescan)
>  {
>  	char devname[64];
>  	unsigned char scsi_cmd[MAX_COMMAND_SIZE];
> @@ -1546,7 +1552,7 @@ void scsi_rescan_device(struct device *dev)
>  EXPORT_SYMBOL(scsi_rescan_device);
>  
>  static void __scsi_scan_target(struct device *parent, unsigned int channel,
> -		unsigned int id, u64 lun, int rescan)
> +		unsigned int id, u64 lun, enum scsi_scan_mode rescan)
>  {
>  	struct Scsi_Host *shost = dev_to_shost(parent);
>  	int bflags = 0;
> @@ -1604,7 +1610,10 @@ static void __scsi_scan_target(struct device *parent, unsigned int channel,
>   * @channel:	channel to scan
>   * @id:		target id to scan
>   * @lun:	Specific LUN to scan or SCAN_WILD_CARD
> - * @rescan:	passed to LUN scanning routines
> + * @rescan:	passed to LUN scanning routines; SCSI_SCAN_INITIAL for
> + *              no rescan, SCSI_SCAN_RESCAN to rescan existing LUNs,
> + *              and SCSI_SCAN_MANUAL to force scanning even if
> + *              'scan=manual' is set.
>   *
>   * Description:
>   *     Scan the target id on @parent, @channel, and @id. Scan at least LUN 0,
> @@ -1614,13 +1623,17 @@ static void __scsi_scan_target(struct device *parent, unsigned int channel,
>   *     sequential scan of LUNs on the target id.
>   **/
>  void scsi_scan_target(struct device *parent, unsigned int channel,
> -		      unsigned int id, u64 lun, int rescan)
> +		      unsigned int id, u64 lun, enum scsi_scan_mode rescan)
>  {
>  	struct Scsi_Host *shost = dev_to_shost(parent);
>  
>  	if (strncmp(scsi_scan_type, "none", 4) == 0)
>  		return;
>  
> +	if (rescan != SCSI_SCAN_MANUAL &&
> +	    strncmp(scsi_scan_type, "manual", 6) == 0)
> +		return;
> +
>  	mutex_lock(&shost->scan_mutex);
>  	if (!shost->async_scan)
>  		scsi_complete_async_scans();
> @@ -1634,7 +1647,8 @@ void scsi_scan_target(struct device *parent, unsigned int channel,
>  EXPORT_SYMBOL(scsi_scan_target);
>  
>  static void scsi_scan_channel(struct Scsi_Host *shost, unsigned int channel,
> -			      unsigned int id, u64 lun, int rescan)
> +			      unsigned int id, u64 lun,
> +			      enum scsi_scan_mode rescan)
>  {
>  	uint order_id;
>  
> @@ -1665,7 +1679,8 @@ static void scsi_scan_channel(struct Scsi_Host *shost, unsigned int channel,
>  }
>  
>  int scsi_scan_host_selected(struct Scsi_Host *shost, unsigned int channel,
> -			    unsigned int id, u64 lun, int rescan)
> +			    unsigned int id, u64 lun,
> +			    enum scsi_scan_mode rescan)
>  {
>  	SCSI_LOG_SCAN_BUS(3, shost_printk (KERN_INFO, shost,
>  		"%s: <%u:%u:%llu>\n",
> @@ -1844,7 +1859,8 @@ void scsi_scan_host(struct Scsi_Host *shost)
>  {
>  	struct async_scan_data *data;
>  
> -	if (strncmp(scsi_scan_type, "none", 4) == 0)
> +	if (strncmp(scsi_scan_type, "none", 4) == 0 ||
> +	    strncmp(scsi_scan_type, "manual", 6) == 0)
>  		return;
>  	if (scsi_autopm_get_host(shost) < 0)
>  		return;
> diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
> index 92ffd24..3b2045f 100644
> --- a/drivers/scsi/scsi_sysfs.c
> +++ b/drivers/scsi/scsi_sysfs.c
> @@ -143,7 +143,8 @@ static int scsi_scan(struct Scsi_Host *shost, const char *str)
>  	if (shost->transportt->user_scan)
>  		res = shost->transportt->user_scan(shost, channel, id, lun);
>  	else
> -		res = scsi_scan_host_selected(shost, channel, id, lun, 1);
> +		res = scsi_scan_host_selected(shost, channel, id, lun,
> +					      SCSI_SCAN_MANUAL);
>  	return res;
>  }
>  
> diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c
> index 8a88226..bf28c68 100644
> --- a/drivers/scsi/scsi_transport_fc.c
> +++ b/drivers/scsi/scsi_transport_fc.c
> @@ -2110,7 +2110,8 @@ fc_user_scan_tgt(struct Scsi_Host *shost, uint channel, uint id, u64 lun)
>  		if ((channel == rport->channel) &&
>  		    (id == rport->scsi_target_id)) {
>  			spin_unlock_irqrestore(shost->host_lock, flags);
> -			scsi_scan_target(&rport->dev, channel, id, lun, 1);
> +			scsi_scan_target(&rport->dev, channel, id, lun,
> +					 SCSI_SCAN_MANUAL);
>  			return;
>  		}
>  	}
> @@ -3277,7 +3278,8 @@ fc_scsi_scan_rport(struct work_struct *work)
>  	    (rport->roles & FC_PORT_ROLE_FCP_TARGET) &&
>  	    !(i->f->disable_target_scan)) {
>  		scsi_scan_target(&rport->dev, rport->channel,
> -			rport->scsi_target_id, SCAN_WILD_CARD, 1);
> +				 rport->scsi_target_id, SCAN_WILD_CARD,
> +				 SCSI_SCAN_RESCAN);
>  	}
>  
>  	spin_lock_irqsave(shost->host_lock, flags);
> diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
> index 4414816..7a759a9 100644
> --- a/drivers/scsi/scsi_transport_iscsi.c
> +++ b/drivers/scsi/scsi_transport_iscsi.c
> @@ -1783,6 +1783,7 @@ struct iscsi_scan_data {
>  	unsigned int channel;
>  	unsigned int id;
>  	u64 lun;
> +	enum scsi_scan_mode rescan;
>  };
>  
>  static int iscsi_user_scan_session(struct device *dev, void *data)
> @@ -1819,7 +1820,7 @@ static int iscsi_user_scan_session(struct device *dev, void *data)
>  		    (scan_data->id == SCAN_WILD_CARD ||
>  		     scan_data->id == id))
>  			scsi_scan_target(&session->dev, 0, id,
> -					 scan_data->lun, 1);
> +					 scan_data->lun, scan_data->rescan);
>  	}
>  
>  user_scan_exit:
> @@ -1836,6 +1837,7 @@ static int iscsi_user_scan(struct Scsi_Host *shost, uint channel,
>  	scan_data.channel = channel;
>  	scan_data.id = id;
>  	scan_data.lun = lun;
> +	scan_data.rescan = SCSI_SCAN_MANUAL;
>  
>  	return device_for_each_child(&shost->shost_gendev, &scan_data,
>  				     iscsi_user_scan_session);
> @@ -1852,6 +1854,7 @@ static void iscsi_scan_session(struct work_struct *work)
>  	scan_data.channel = 0;
>  	scan_data.id = SCAN_WILD_CARD;
>  	scan_data.lun = SCAN_WILD_CARD;
> +	scan_data.rescan = SCSI_SCAN_RESCAN;
>  
>  	iscsi_user_scan_session(&session->dev, &scan_data);
>  	atomic_dec(&ihost->nr_scans);
> diff --git a/drivers/scsi/scsi_transport_sas.c b/drivers/scsi/scsi_transport_sas.c
> index b6f958193..3f0ff07 100644
> --- a/drivers/scsi/scsi_transport_sas.c
> +++ b/drivers/scsi/scsi_transport_sas.c
> @@ -1614,7 +1614,8 @@ int sas_rphy_add(struct sas_rphy *rphy)
>  		else
>  			lun = 0;
>  
> -		scsi_scan_target(&rphy->dev, 0, rphy->scsi_target_id, lun, 0);
> +		scsi_scan_target(&rphy->dev, 0, rphy->scsi_target_id, lun,
> +				 SCSI_SCAN_INITIAL);
>  	}
>  
>  	return 0;
> @@ -1739,8 +1740,8 @@ static int sas_user_scan(struct Scsi_Host *shost, uint channel,
>  
>  		if ((channel == SCAN_WILD_CARD || channel == 0) &&
>  		    (id == SCAN_WILD_CARD || id == rphy->scsi_target_id)) {
> -			scsi_scan_target(&rphy->dev, 0,
> -					 rphy->scsi_target_id, lun, 1);
> +			scsi_scan_target(&rphy->dev, 0, rphy->scsi_target_id,
> +					 lun, SCSI_SCAN_MANUAL);
>  		}
>  	}
>  	mutex_unlock(&sas_host->lock);
> diff --git a/drivers/scsi/snic/snic_disc.c b/drivers/scsi/snic/snic_disc.c
> index 5f63217..5f48795 100644
> --- a/drivers/scsi/snic/snic_disc.c
> +++ b/drivers/scsi/snic/snic_disc.c
> @@ -171,7 +171,7 @@ snic_scsi_scan_tgt(struct work_struct *work)
>  			 tgt->channel,
>  			 tgt->scsi_tgt_id,
>  			 SCAN_WILD_CARD,
> -			 1);
> +			 SCSI_SCAN_RESCAN);
>  
>  	spin_lock_irqsave(shost->host_lock, flags);
>  	tgt->flags &= ~SNIC_TGT_SCAN_PENDING;
> diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
> index c067019..61341d3 100644
> --- a/include/scsi/scsi_device.h
> +++ b/include/scsi/scsi_device.h
> @@ -50,6 +50,12 @@ enum scsi_device_state {
>  	SDEV_CREATED_BLOCK,	/* same as above but for created devices */
>  };
>  
> +enum scsi_scan_mode {
> +	SCSI_SCAN_INITIAL = 0,
> +	SCSI_SCAN_RESCAN,
> +	SCSI_SCAN_MANUAL,
> +};
> +
>  enum scsi_device_event {
>  	SDEV_EVT_MEDIA_CHANGE	= 1,	/* media has changed */
>  	SDEV_EVT_INQUIRY_CHANGE_REPORTED,		/* 3F 03  UA reported */
> @@ -391,7 +397,8 @@ extern void scsi_device_resume(struct scsi_device *sdev);
>  extern void scsi_target_quiesce(struct scsi_target *);
>  extern void scsi_target_resume(struct scsi_target *);
>  extern void scsi_scan_target(struct device *parent, unsigned int channel,
> -			     unsigned int id, u64 lun, int rescan);
> +			     unsigned int id, u64 lun,
> +			     enum scsi_scan_mode rescan);
>  extern void scsi_target_reap(struct scsi_target *);
>  extern void scsi_target_block(struct device *);
>  extern void scsi_target_unblock(struct device *, enum scsi_device_state);

Reviewed-by: Ewan D. Milne <emilne@redhat.com>



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

* Re: [PATCHv3] scsi: disable automatic target scan
  2016-03-17  7:39 [PATCHv3] scsi: disable automatic target scan Hannes Reinecke
  2016-03-18 19:39 ` Ewan D. Milne
@ 2016-03-18 21:56 ` Bart Van Assche
  2016-03-19 15:18   ` Hannes Reinecke
  2016-03-29  0:27 ` Martin K. Petersen
  2016-03-30 19:41 ` Benjamin Block
  3 siblings, 1 reply; 14+ messages in thread
From: Bart Van Assche @ 2016-03-18 21:56 UTC (permalink / raw)
  To: Hannes Reinecke, Martin K. Petersen
  Cc: Christoph Hellwig, James Bottomley, linux-scsi

On 03/17/2016 12:39 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.

Hello Hannes,

Will setting scsi_scan_type to 'manual' allow a system to boot from a 
SCSI disk? If not, are there alternatives to this approach? Would it be 
a valid alternative to e.g. introduce a new threshold parameter such 
that only LUN numbers below this threshold are scanned during boot?

Thanks,

Bart.

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

* Re: [PATCHv3] scsi: disable automatic target scan
  2016-03-18 21:56 ` Bart Van Assche
@ 2016-03-19 15:18   ` Hannes Reinecke
  2016-03-19 15:29     ` Laurence Oberman
  2016-03-21  1:24     ` Bart Van Assche
  0 siblings, 2 replies; 14+ messages in thread
From: Hannes Reinecke @ 2016-03-19 15:18 UTC (permalink / raw)
  To: Bart Van Assche, Martin K. Petersen
  Cc: Christoph Hellwig, James Bottomley, linux-scsi

On 03/18/2016 10:56 PM, Bart Van Assche wrote:
> On 03/17/2016 12:39 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.
> 
> Hello Hannes,
> 
> Will setting scsi_scan_type to 'manual' allow a system to boot from a
> SCSI disk? If not, are there alternatives to this approach? Would it be
> a valid alternative to e.g. introduce a new threshold parameter such
> that only LUN numbers below this threshold are scanned during boot?
> 
I have a patch for dracut, which will generate udev rules for all
devices required for mounting the root fs.
Once the system is booted properly I've got another patch for systemd
which switches back to 'normal' scanning (ie by writing 'sync' into
/sys/modules/scsi_mod/parameters/scan) and rescan all scsi hosts.

With that there's no need to have any arbitrary limits; only the
necessary devices are enabled during boot.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		      zSeries & Storage
hare@suse.de			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCHv3] scsi: disable automatic target scan
  2016-03-19 15:18   ` Hannes Reinecke
@ 2016-03-19 15:29     ` Laurence Oberman
  2016-03-21  1:24     ` Bart Van Assche
  1 sibling, 0 replies; 14+ messages in thread
From: Laurence Oberman @ 2016-03-19 15:29 UTC (permalink / raw)
  To: Hannes Reinecke
  Cc: Bart Van Assche, Martin K. Petersen, Christoph Hellwig,
	James Bottomley, linux-scsi

Hi Hannes,

Please share those dracut patches because I want to test this patch series.
Which kernel is the diff against for the scan patches.

Thanks 

Laurence Oberman
Principal Software Maintenance Engineer
Red Hat Global Support Services

----- Original Message -----
From: "Hannes Reinecke" <hare@suse.de>
To: "Bart Van Assche" <bart.vanassche@sandisk.com>, "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: "Christoph Hellwig" <hch@lst.de>, "James Bottomley" <james.bottomley@hansenpartnership.com>, linux-scsi@vger.kernel.org
Sent: Saturday, March 19, 2016 11:18:09 AM
Subject: Re: [PATCHv3] scsi: disable automatic target scan

On 03/18/2016 10:56 PM, Bart Van Assche wrote:
> On 03/17/2016 12:39 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.
> 
> Hello Hannes,
> 
> Will setting scsi_scan_type to 'manual' allow a system to boot from a
> SCSI disk? If not, are there alternatives to this approach? Would it be
> a valid alternative to e.g. introduce a new threshold parameter such
> that only LUN numbers below this threshold are scanned during boot?
> 
I have a patch for dracut, which will generate udev rules for all
devices required for mounting the root fs.
Once the system is booted properly I've got another patch for systemd
which switches back to 'normal' scanning (ie by writing 'sync' into
/sys/modules/scsi_mod/parameters/scan) and rescan all scsi hosts.

With that there's no need to have any arbitrary limits; only the
necessary devices are enabled during boot.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		      zSeries & Storage
hare@suse.de			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCHv3] scsi: disable automatic target scan
  2016-03-19 15:18   ` Hannes Reinecke
  2016-03-19 15:29     ` Laurence Oberman
@ 2016-03-21  1:24     ` Bart Van Assche
  2016-03-21  7:15       ` Hannes Reinecke
  1 sibling, 1 reply; 14+ messages in thread
From: Bart Van Assche @ 2016-03-21  1:24 UTC (permalink / raw)
  To: Hannes Reinecke, Martin K. Petersen
  Cc: Christoph Hellwig, James Bottomley, linux-scsi

On 03/19/16 08:18, Hannes Reinecke wrote:
> On 03/18/2016 10:56 PM, Bart Van Assche wrote:
>> On 03/17/2016 12:39 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.
>>
>> Hello Hannes,
>>
>> Will setting scsi_scan_type to 'manual' allow a system to boot from a
>> SCSI disk? If not, are there alternatives to this approach? Would it be
>> a valid alternative to e.g. introduce a new threshold parameter such
>> that only LUN numbers below this threshold are scanned during boot?
>>
> I have a patch for dracut, which will generate udev rules for all
> devices required for mounting the root fs.
> Once the system is booted properly I've got another patch for systemd
> which switches back to 'normal' scanning (ie by writing 'sync' into
> /sys/modules/scsi_mod/parameters/scan) and rescan all scsi hosts.
>
> With that there's no need to have any arbitrary limits; only the
> necessary devices are enabled during boot.

Hello Hannes,

That sounds like a really interesting approach. Will this approach also 
work if the SCSI host and/or LUN numbers change during a reboot?

Thanks,

Bart.

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

* Re: [PATCHv3] scsi: disable automatic target scan
  2016-03-21  1:24     ` Bart Van Assche
@ 2016-03-21  7:15       ` Hannes Reinecke
  2016-03-21 20:40         ` Laurence Oberman
  0 siblings, 1 reply; 14+ messages in thread
From: Hannes Reinecke @ 2016-03-21  7:15 UTC (permalink / raw)
  To: Bart Van Assche, Martin K. Petersen
  Cc: Christoph Hellwig, James Bottomley, linux-scsi

On 03/21/2016 02:24 AM, Bart Van Assche wrote:
> On 03/19/16 08:18, Hannes Reinecke wrote:
>> On 03/18/2016 10:56 PM, Bart Van Assche wrote:
>>> On 03/17/2016 12:39 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.
>>>
>>> Hello Hannes,
>>>
>>> Will setting scsi_scan_type to 'manual' allow a system to boot
>>> from a
>>> SCSI disk? If not, are there alternatives to this approach? Would
>>> it be
>>> a valid alternative to e.g. introduce a new threshold parameter such
>>> that only LUN numbers below this threshold are scanned during boot?
>>>
>> I have a patch for dracut, which will generate udev rules for all
>> devices required for mounting the root fs.
>> Once the system is booted properly I've got another patch for systemd
>> which switches back to 'normal' scanning (ie by writing 'sync' into
>> /sys/modules/scsi_mod/parameters/scan) and rescan all scsi hosts.
>>
>> With that there's no need to have any arbitrary limits; only the
>> necessary devices are enabled during boot.
> 
> Hello Hannes,
> 
> That sounds like a really interesting approach. Will this approach
> also work if the SCSI host and/or LUN numbers change during a reboot?
> 
It's independent on the SCSI host as it just looks for the rport ID
(FC WWPN, SAS ID, or iSCSI target name). The LUN number, however, is
fixed; the whole point of this exercise is that you want to blank
out individual LUNs behind a given target.
Hence you need to able to address the LUNs in the first place.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCHv3] scsi: disable automatic target scan
  2016-03-21  7:15       ` Hannes Reinecke
@ 2016-03-21 20:40         ` Laurence Oberman
  2016-03-22 17:36           ` Hannes Reinecke
  2016-03-24  2:35           ` Laurence Oberman
  0 siblings, 2 replies; 14+ messages in thread
From: Laurence Oberman @ 2016-03-21 20:40 UTC (permalink / raw)
  To: Hannes Reinecke
  Cc: Bart Van Assche, Martin K. Petersen, Christoph Hellwig,
	James Bottomley, linux-scsi

Hello Hannes

Please share latest scripts and an example of how you are using them.
I have some scripts from last November, that you posted but I am sure they have changed.
If not then I will modify them as appropriate, just let me know.

I have added the patches and booted the system set to async, so before I boot with scsi_mod.scan=manual want to prepare my test system.
This feature may be a very useful feature we would want to include in RHEL as we struggle with large LUN boot configurations all the time.
When you have time and thanks

Laurence Oberman
Principal Software Maintenance Engineer
Red Hat Global Support Services

----- Original Message -----
From: "Hannes Reinecke" <hare@suse.de>
To: "Bart Van Assche" <bart.vanassche@sandisk.com>, "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: "Christoph Hellwig" <hch@lst.de>, "James Bottomley" <james.bottomley@hansenpartnership.com>, linux-scsi@vger.kernel.org
Sent: Monday, March 21, 2016 3:15:10 AM
Subject: Re: [PATCHv3] scsi: disable automatic target scan

On 03/21/2016 02:24 AM, Bart Van Assche wrote:
> On 03/19/16 08:18, Hannes Reinecke wrote:
>> On 03/18/2016 10:56 PM, Bart Van Assche wrote:
>>> On 03/17/2016 12:39 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.
>>>
>>> Hello Hannes,
>>>
>>> Will setting scsi_scan_type to 'manual' allow a system to boot
>>> from a
>>> SCSI disk? If not, are there alternatives to this approach? Would
>>> it be
>>> a valid alternative to e.g. introduce a new threshold parameter such
>>> that only LUN numbers below this threshold are scanned during boot?
>>>
>> I have a patch for dracut, which will generate udev rules for all
>> devices required for mounting the root fs.
>> Once the system is booted properly I've got another patch for systemd
>> which switches back to 'normal' scanning (ie by writing 'sync' into
>> /sys/modules/scsi_mod/parameters/scan) and rescan all scsi hosts.
>>
>> With that there's no need to have any arbitrary limits; only the
>> necessary devices are enabled during boot.
> 
> Hello Hannes,
> 
> That sounds like a really interesting approach. Will this approach
> also work if the SCSI host and/or LUN numbers change during a reboot?
> 
It's independent on the SCSI host as it just looks for the rport ID
(FC WWPN, SAS ID, or iSCSI target name). The LUN number, however, is
fixed; the whole point of this exercise is that you want to blank
out individual LUNs behind a given target.
Hence you need to able to address the LUNs in the first place.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCHv3] scsi: disable automatic target scan
  2016-03-21 20:40         ` Laurence Oberman
@ 2016-03-22 17:36           ` Hannes Reinecke
  2016-03-24  2:35           ` Laurence Oberman
  1 sibling, 0 replies; 14+ messages in thread
From: Hannes Reinecke @ 2016-03-22 17:36 UTC (permalink / raw)
  To: Laurence Oberman
  Cc: Bart Van Assche, Martin K. Petersen, Christoph Hellwig,
	James Bottomley, linux-scsi

[-- Attachment #1: Type: text/plain, Size: 1543 bytes --]

On 03/21/2016 09:40 PM, Laurence Oberman wrote:
> Hello Hannes
> 
> Please share latest scripts and an example of how you are using them.
> I have some scripts from last November, that you posted but I am sure they have changed.
> If not then I will modify them as appropriate, just let me know.
> 
> I have added the patches and booted the system set to async, so before I boot with
> scsi_mod.scan=manual want to prepare my test system.
> This feature may be a very useful feature we would want to include in RHEL as we
> struggle with large LUN boot configurations all the time.

Oh, really? Hardly a surprise.
In fact, I'm constantly surprised that RHEL ships with systemd
enabled, apparently without any issues.
Especially in large machines.
As we found to our dismay; I spent about a year to get things
running smoothly.
Or, to be precise, running at all.

Anyway.

Attached is the original patch to dracut; please check if it's the
correct version (I've changed the 'disabled' to 'manual' for
upstream submission).

I haven't included the systemd service; that's actually quite
trivial: reset the scan mode (as it's now writeable) and call
rescan-scsi-bus.sh or equivalent.

But please add a 'Tested-by' or equivalent to the upstream patch, to
add a bit more urgency to it.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-95lunmask-Add-module-to-handle-LUN-masking.patch --]
[-- Type: text/x-patch; name="0001-95lunmask-Add-module-to-handle-LUN-masking.patch", Size: 6857 bytes --]

From 1d427bcf3527ba96828a4bd5231409967ff096b4 Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.de>
Date: Wed, 11 Nov 2015 12:20:33 +0100
Subject: [PATCH] 95lunmask: Add module to handle LUN masking

Using the module option 'scsi_mod.scan=disabled'
this implements LUN masking by selectively enable only those
devices required for booting.

References: bsc#954600

Signed-off-by: Hannes Reinecke <hare@suse.de>
---
 modules.d/95lunmask/fc_transport_scan_lun.sh  | 26 ++++++++++
 modules.d/95lunmask/module-setup.sh           | 70 +++++++++++++++++++++++++++
 modules.d/95lunmask/parse-lunmask.sh          | 40 +++++++++++++++
 modules.d/95lunmask/sas_transport_scan_lun.sh | 26 ++++++++++
 4 files changed, 162 insertions(+)
 create mode 100755 modules.d/95lunmask/fc_transport_scan_lun.sh
 create mode 100755 modules.d/95lunmask/module-setup.sh
 create mode 100755 modules.d/95lunmask/parse-lunmask.sh
 create mode 100755 modules.d/95lunmask/sas_transport_scan_lun.sh

diff --git a/modules.d/95lunmask/fc_transport_scan_lun.sh b/modules.d/95lunmask/fc_transport_scan_lun.sh
new file mode 100755
index 0000000..d9f84a3
--- /dev/null
+++ b/modules.d/95lunmask/fc_transport_scan_lun.sh
@@ -0,0 +1,26 @@
+#!/bin/bash
+#
+# fc_transport_lun_scan
+#
+# Selectively enable individual LUNs behind an FC remote port
+#
+# ACTION=="add", SUBSYSTEM=="fc_transport", ATTR{port_name}=="wwpn", \
+#    PROGRAM="fc_transport_lun_scan lun"
+#
+
+[ -z $DEVPATH ] && exit 1
+
+if [ -n "$1" ] ; then
+    LUN=$1
+else
+    LUN=-
+fi
+ID=${DEVPATH##*/rport-}
+HOST=${ID%%:*}
+CHANNEL=${ID%%-*}
+CHANNEL=${CHANNEL#*:}
+if [ -f /sys$DEVPATH/scsi_target_id ] ; then
+    TARGET=$(cat /sys$DEVPATH/scsi_target_id)
+fi
+[ -z "$TARGET" ] && exit 1
+echo $CHANNEL $TARGET $LUN > /sys/class/scsi_host/host$HOST/scan
diff --git a/modules.d/95lunmask/module-setup.sh b/modules.d/95lunmask/module-setup.sh
new file mode 100755
index 0000000..c88b1c0
--- /dev/null
+++ b/modules.d/95lunmask/module-setup.sh
@@ -0,0 +1,70 @@
+#!/bin/bash
+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
+# ex: ts=8 sw=4 sts=4 et filetype=sh
+
+# called by dracut
+cmdline() {
+    get_lunmask() {
+        local _dev=$1
+        local _devpath=$(cd -P /sys/dev/block/$_dev ; echo $PWD)
+        local _sdev _lun _rport _end_device _classdev _wwpn _sas_address
+
+        [ "${_devpath#*/sd}" == "$_devpath" ] && return 1
+        _sdev="${_devpath%%/block/*}"
+        _lun="${_sdev##*:}"
+        # Check for FibreChannel
+        _rport="${_devpath##*/rport-}"
+        if [ "$_rport" != "$_devpath" ] ; then
+            _rport="${_rport%%/*}"
+            _classdev="/sys/class/fc_remote_ports/rport-${_rport}"
+            [ -d "$_classdev" ] || return 1
+            _wwpn=$(cat ${_classdev}/port_name)
+            echo "rd.lunmask=fc,${_wwpn},${_lun}"
+            return 0
+        fi
+        # Check for SAS
+        _end_device="${_devpath##*/end_device-}"
+        if [ "$_end_device" != "$_devpath" ] ; then
+            _end_device="${_end_device%%/*}"
+            _classdev="/sys/class/sas_device/end_device-${_end_device}"
+            [ -e "$_classdev" ] || return 1
+            _sas_address=$(cat ${_classdev}/sas_address)
+            echo "rd.lunmask=sas,${_sas_address},${_lun}"
+            return 0
+        fi
+        return 1
+    }
+    [[ $hostonly ]] || [[ $mount_needs ]] && {
+        for_each_host_dev_and_slaves_all get_lunmask
+    } | sort | uniq
+}
+
+# called by dracut
+check() {
+    [[ $hostonly ]] || [[ $mount_needs ]] && {
+        [ -w /sys/module/scsi_mod/parameters/scan ] || return 255
+        scan_type=$(cat /sys/module/scsi_mod/parameters/scan)
+        [ "$scan_type" = "disabled" ] && return 0
+        return 255
+    }
+    return 0
+}
+
+# called by dracut
+depends() {
+    return 0
+}
+
+# called by dracut
+install() {
+    inst_script "$moddir/fc_transport_scan_lun.sh" /usr/lib/udev/fc_transport_scan_lun.sh
+    inst_script "$moddir/sas_transport_scan_lun.sh" /usr/lib/udev/sas_transport_scan_lun.sh
+    inst_hook cmdline 30 "$moddir/parse-lunmask.sh"
+    if [[ $hostonly_cmdline == "yes" ]] ; then
+        local _lunmask
+
+        for _lunmask in $(cmdline) ; do
+            printf "%s\n" "$_lunmask" >> "${initdir}/etc/cmdline.d/95lunmask.conf"
+        done
+    fi
+}
diff --git a/modules.d/95lunmask/parse-lunmask.sh b/modules.d/95lunmask/parse-lunmask.sh
new file mode 100755
index 0000000..81dc412
--- /dev/null
+++ b/modules.d/95lunmask/parse-lunmask.sh
@@ -0,0 +1,40 @@
+#!/bin/sh
+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
+# ex: ts=8 sw=4 sts=4 et filetype=sh
+
+create_udev_rule() {
+    local transport=$1
+    local tgtid=$2
+    local lun=$3
+    local _rule=/etc/udev/rules.d/51-${transport}-lunmask-${tgtid}.rules
+    local _cu_type _dev_type
+
+    [ -e ${_rule} ] && return 0
+
+    if [ ! -f "$_rule" ] ; then
+        if [ "$transport" = "fc" ] ; then
+            cat > $_rule <<EOF
+ACTION=="add", SUBSYSTEM=="fc_remote_ports", ATTR{port_name}=="$tgtid", PROGRAM="fc_transport_scan_lun.sh $lun"
+EOF
+        elif [ "$transport" = "sas" ] ; then
+            cat > $_rule <<EOF
+ACTION=="add", SUBSYSTEM=="sas_device", ATTR{sas_address}=="$tgtid", PROGRAM="sas_transport_scan_lun.sh $lun"
+EOF
+        fi
+    fi
+}
+
+for lunmask_arg in $(getargs rd.lunmask); do
+    (
+        local OLDIFS="$IFS"
+        local IFS=","
+        set $lunmask_arg
+        IFS="$OLDIFS"
+        if [ -d /sys/module/scsi_mod ] ; then
+            echo -n "disabled" > /sys/module/scsi_mod/parameters/scan
+        elif [ ! -f /etc/modprobe.d/95lunmask.conf ] ; then
+            echo "options scsi_mod scan=disabled" > /etc/modprobe.d/95lunmask.conf
+        fi
+        create_udev_rule $1 $2 $3
+    )
+done
diff --git a/modules.d/95lunmask/sas_transport_scan_lun.sh b/modules.d/95lunmask/sas_transport_scan_lun.sh
new file mode 100755
index 0000000..f7702f8
--- /dev/null
+++ b/modules.d/95lunmask/sas_transport_scan_lun.sh
@@ -0,0 +1,26 @@
+#!/bin/bash
+#
+# sas_transport_lun_scan
+#
+# Selectively enable individual LUNs behind a SAS end device
+#
+# ACTION=="add", SUBSYSTEM=="sas_transport", ATTR{sas_address}=="sas_addr", \
+#    PROGRAM="sas_transport_lun_scan lun"
+#
+
+[ -z $DEVPATH ] && exit 1
+
+if [ -n "$1" ] ; then
+    LUN=$1
+else
+    LUN=-
+fi
+ID=${DEVPATH##*/end_device-}
+HOST=${ID%%:*}
+CHANNEL=${ID%%-*}
+CHANNEL=${CHANNEL#*:}
+if [ -f /sys$DEVPATH/scsi_target_id ] ; then
+    TARGET=$(cat /sys$DEVPATH/scsi_target_id)
+fi
+[ -z "$TARGET" ] && exit 1
+echo 0 $TARGET $LUN > /sys/class/scsi_host/host$HOST/scan
-- 
2.6.2


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

* Re: [PATCHv3] scsi: disable automatic target scan
  2016-03-21 20:40         ` Laurence Oberman
  2016-03-22 17:36           ` Hannes Reinecke
@ 2016-03-24  2:35           ` Laurence Oberman
  1 sibling, 0 replies; 14+ messages in thread
From: Laurence Oberman @ 2016-03-24  2:35 UTC (permalink / raw)
  To: Hannes Reinecke
  Cc: Bart Van Assche, Martin K. Petersen, Christoph Hellwig,
	James Bottomley, linux-scsi

Hello

Tested Hannes's scan disable patch (subject above) with hpsa module patch below.
Because of the way the hpsa works I created a module that will force the scan when all scans are manual.
I also tested Hannes's patch with boot-from-san via F/C and validated the patch in subject using Hannes's original dracut lunmask patch.

For Hannes's scan disable patch 
Tested-by: Laurence Oberman <loberman@redhat.com>

linux16 /vmlinuz-4.4.5scan root=/dev/mapper/rhel-root ro crashkernel=512M@64M rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap console=ttyS0,115200n8 scsi_mod.scan=manual rd.hpsa=0 rdloaddriver=hpsa

Additional HPSA module for dracut, needs to be cleaned up and reviewed internally here at Red Hat for a separate submission later.
Included for others who want to test this.
We need this for hpsa as this is by far the most popular boot controller we face.

diff -Nurp modules.d.orig/06hpsa/hpsa.sh modules.d/06hpsa/hpsa.sh
--- modules.d.orig/06hpsa/hpsa.sh	1969-12-31 19:00:00.000000000 -0500
+++ modules.d/06hpsa/hpsa.sh	2016-03-23 21:38:33.157233465 -0400
@@ -0,0 +1,6 @@
+#!/bin/sh
+### hpsa.sh: Called by the parse-hpsa.sh script to create the scan script ###
+### Laurence Oberman loberman@redhat.com
+. /lib/dracut-lib.sh
+### The actual script that scans the hpsa for LUNS 
+/bin/sh /sbin/hpsa_scan.sh
diff -Nurp modules.d.orig/06hpsa/module-setup.sh modules.d/06hpsa/module-setup.sh
--- modules.d.orig/06hpsa/module-setup.sh	1969-12-31 19:00:00.000000000 -0500
+++ modules.d/06hpsa/module-setup.sh	2016-03-23 21:40:36.994767642 -0400
@@ -0,0 +1,14 @@
+#!/bin/sh
+#### Test the hpsa driver load with scan #####
+#### Laurence Oberman loberman@redhat.com 
+### module-setup.sh - Required for every module
+### Standard script invocations required
+check() {
+	return 0
+}
+
+### Install the hpsa.sh in the module directory
+install() {
+	inst_hook cmdline 20 "$moddir/parse-hpsa.sh"
+	inst_simple "$moddir/hpsa.sh" /sbin/hpsa.sh
+}
diff -Nurp modules.d.orig/06hpsa/parse-hpsa.sh modules.d/06hpsa/parse-hpsa.sh
--- modules.d.orig/06hpsa/parse-hpsa.sh	1969-12-31 19:00:00.000000000 -0500
+++ modules.d/06hpsa/parse-hpsa.sh	2016-03-23 21:42:28.141856121 -0400
@@ -0,0 +1,18 @@
+#!/bin.bash
+### Laurence Oberman loberman@redhat.com
+### parse-hpsa.sh 
+### Parses the rd.hpsa=x tp get the host number
+### Using rdloaddriver=hpsa will enforce hpsa becoming scsi0
+
+for p in $(getargs rd.hpsa=); do
+(
+     echo "echo 1 > /sys/class/scsi_host/host$p/rescan" > /sbin/hpsa_scan.sh
+    _do_hpsa=1
+)
+done
+
+### Standard way to call the script from udev
+/sbin/initqueue --settled --unique --onetime /bin/sh /sbin/hpsa.sh
+#/bin/sh /sbin/hpsa.sh
+unset _do_hpsa
+


Test log
--------

[    5.591817] HP HPSA Driver (v 3.4.14-0)
[    5.593799] hpsa 0000:05:00.0: can't disable ASPM; OS doesn't have ASPM control
[    5.597423] hpsa 0000:05:00.0: MSI-X capable controller
[    5.600181] hpsa 0000:05:00.0: only 16 MSI-X vectors available
[    5.602995] hpsa 0000:05:00.0: Logical aborts not supported
[    5.606011] hpsa 0000:05:00.0: HP SSD Smart Path aborts not supported
[    5.631300] scsi host0: hpsa

[  OK  ] Started dracut pre-udev hook.
         Starting udev Kernel Device Manager...
[  OK  ] Started udev Kernel Device Manager.
         Starting udev Coldplug all Devices...
[    5.676569] clocksource: Switched to clocksource tsc
         Mounting Configuration File System...
[  OK  ] Mounted Configuration File System.
[  OK  ] Started udev Coldplug all Devices.
         Starting dracut initqueue hook...
         Starting Show Plymouth Boot Screen...
[  OK  ] Reached target System Initialization.
[    5.708890] bnx2: QLogic bnx2 Gigabit Ethernet Driver v2.2.6 (January 29, 2014)
[  OK  ] Started Show Plymouth Boot Screen.
[    5.749275] bnx2 0000:03:00.0 eth0: Broadcom NetXtreme II BCM5709 1000Base-T (C0) PCI Express found at mem f4000000, IRQ 16, node addr e4:11:5b:b8:ea:6a
[  OK  ] Reached target Paths.
[  OK  ] Reached target Basic System.
[    5.828145] bnx2 0000:03:00.1 eth1: Broadcom NetXtreme II BCM5709 1000Base-T (C0) PCI Express found at mem f2000000, IRQ 17, node addr e4:11:5b:b8:ea:6c
[    5.905874] bnx2 0000:04:00.0 eth2: Broadcom NetXtreme II BCM5709 1000Base-T (C0) PCI Express found at mem f8000000, IRQ 18, node addr e4:11:5b:b8:ea:6e
[    5.906632] bnx2 0000:04:00.1 eth3: Broadcom NetXtreme II BCM5709 1000Base-T (C0) PCI Express found at mem f6000000, IRQ 19, node addr e4:11:5b:b8:ea:70
[    6.061847] bnx2 0000:04:00.1 enp4s0f1: renamed from eth3
[    6.098914] mlx5_core 0000:08:00.0: firmware version: 12.14.2036
[    6.147046] Emulex LightPulse Fibre Channel SCSI driver 11.0.0.0.
[    6.147054] [drm] Initialized drm 1.1.0 20060810
[    6.147148] qla2xxx [0000:00:00.0]-0005: : QLogic Fibre Channel HBA Driver: 8.07.00.26-k.
[    6.147278] qla2xxx [0000:0e:00.0]-001d: : Found an ISP2432 irq 27 iobase 0xffffc900192b8000.
[    6.147618] qla2xxx [0000:0e:00.0]-0034:1: MSI-X: Unsupported ISP 2432 SSVID/SSDID (0x103C,0x7041).
[    6.352283] Copyright(c) 2004-2015 Emulex.  All rights reserved.
[    6.387626] scsi host2: Emulex LPe1150 PCIe Fibre Channel Adapter on PCI bus 0b device 00 irq 44
[    6.439004] bnx2 0000:04:00.0 enp4s0f0: renamed from eth2
[    6.470541] scsi host1: qla2xxx
[    6.488476] qla2xxx [0000:0e:00.0]-00fb:1: QLogic HPAE312A - PCI-Express Dual Port 4Gb Fibre Channel HBA.
[    6.540692] qla2xxx [0000:0e:00.0]-00fc:1: ISP2432: PCIe (2.5GT/s x4) @ 0000:0e:00.0 hdma+ host#=1 fw=7.03.00 (9496).
[    6.600102] qla2xxx [0000:0e:00.1]-001d: : Found an ISP2432 irq 45 iobase 0xffffc9001929c000.
[    6.648749] qla2xxx [0000:0e:00.1]-0034:3: MSI-X: Unsupported ISP 2432 SSVID/SSDID (0x103C,0x7041).
[    6.666651] mlx5_core 0000:08:00.1: firmware version: 12.14.2036
[    6.772560] bnx2 0000:03:00.0 enp3s0f0: renamed from eth0
[    7.056571] scsi host3: qla2xxx
[    7.074626] qla2xxx [0000:0e:00.1]-00fb:3: QLogic HPAE312A - PCI-Express Dual Port 4Gb Fibre Channel HBA.
[    7.112413] qla2xxx [0000:0e:00.0]-500a:1: LOOP UP detected (4 Gbps).
[    7.164549] qla2xxx [0000:0e:00.1]-00fc:3: ISP2432: PCIe (2.5GT/s x4) @ 0000:0e:00.1 hdma+ host#=3 fw=7.03.00 (9496).
[    7.225561] bnx2 0000:03:00.1 enp3s0f1: renamed from eth1
[    7.263344] [drm] radeon kernel modesetting enabled.
[    7.292316] [drm] initializing kernel modesetting (RV100 0x1002:0x515E 0x103C:0x31FB).
[    7.337153] [drm] register mmio base: 0xF1CF0000
[    7.363142] [drm] register mmio size: 65536
[    7.387189] radeon 0000:01:03.0: VRAM: 128M 0x00000000E0000000 - 0x00000000E7FFFFFF (64M used)
[    7.434215] radeon 0000:01:03.0: GTT: 512M 0x00000000C0000000 - 0x00000000DFFFFFFF
[    7.477250] [drm] Detected VRAM RAM=128M, BAR=128M
[    7.503412] [drm] RAM width 16bits DDR
[    7.524062] [TTM] Zone  kernel: Available graphics memory: 74007530 kiB
[    7.559905] [TTM] Zone   dma32: Available graphics memory: 2097152 kiB
[    7.595353] [TTM] Initializing pool allocator
[    7.619344] [TTM] Initializing DMA pool allocator
[    7.645975] [drm] radeon: 64M of VRAM memory ready
[    7.672908] [drm] radeon: 512M of GTT memory ready.
[    7.673258] mlx5_ib: Mellanox Connect-IB Infiniband driver v2.2-1 (Feb 2014)
[    7.699187] qla2xxx [0000:0e:00.1]-500a:3: LOOP UP detected (4 Gbps).
[    7.776438] [drm] GART: num cpu pages 131072, num gpu pages 131072
[    7.832626] [drm] PCI GART of 512M enabled (table at 0x0000000031200000).
[    7.870378] radeon 0000:01:03.0: WB disabled
[    7.893537] radeon 0000:01:03.0: fence driver on ring 0 use gpu addr 0x00000000c0000000 and cpu addr 0xffff880031070000
[    7.953875] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[    7.990946] [drm] Driver supports precise vblank timestamp query.
[    7.997365] random: nonblocking pool is initialized
[    8.055710] [drm] radeon: irq initialized.
[    8.078772] [drm] Loading R100 Microcode
[    8.101197] [drm] radeon: ring at 0x00000000C0001000
[    8.129891] [drm] ring test succeeded in 1 usecs
[    8.655299] [drm] ib test succeeded in 0 usecs
[    8.678602] [drm] No TV DAC info found in BIOS
[    8.702772] [drm] Radeon Display Connectors
[    8.726801] [drm] Connector 0:
[    8.744275] [drm]   VGA-1
[    8.759047] [drm]   DDC: 0x60 0x60 0x60 0x60 0x60 0x60 0x60 0x60
[    8.793773] [drm]   Encoders:
[    8.811874] [drm]     CRT1: INTERNAL_DAC1
[    8.834626] [drm] Connector 1:
[    8.851683] [drm]   VGA-2
[    8.866289] [drm]   DDC: 0x6c 0x6c 0x6c 0x6c 0x6c 0x6c 0x6c 0x6c
[    8.899111] [drm]   Encoders:
[    8.914856] [drm]     CRT2: INTERNAL_DAC2
[    8.973015] [drm] fb mappable at 0xE0040000
[    8.996545] [drm] vram apper at 0xE0000000
[    9.019109] [drm] size 786432
[    9.035977] [drm] fb depth is 8
[    9.053620] [drm]    pitch is 1024
[    9.072966] fbcon: radeondrmfb (fb0) is primary device
[    9.228858] Console: switching to colour frame buffer device 128x48
[    9.300257] radeon 0000:01:03.0: fb0: radeondrmfb frame buffer device
[    9.349479] [drm] Initialized radeon 2.43.0 20080528 for 0000:01:03.0 on minor 0
[   10.032430] hpsa 0000:05:00.0: scsi 0:3:0:0: added RAID              HP       P410i            controller SSDSmartPathCap- En- Exp=1
[   10.098586] hpsa 0000:05:00.0: scsi 0:0:0:0: masked Direct-Access     HP       DG146BB976       PHYS DRV SSDSmartPathCap- En- Exp=0
[   10.166547] hpsa 0000:05:00.0: scsi 0:1:0:0: added Direct-Access     HP       LOGICAL VOLUME   RAID-0 SSDSmartPathCap- En- Exp=1
[   10.233884] scsi 0:1:0:0: Direct-Access     HP       LOGICAL VOLUME   6.40 PQ: 0 ANSI: 5
[   10.294476] sd 0:1:0:0: [sda] 286677120 512-byte logical blocks: (147 GB/137 GiB)
[   10.337955] sd 0:1:0:0: [sda] Write Protect is off
[   10.365772] sd 0:1:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[   10.387947] lpfc 0000:0b:00.0: 0:1303 Link Up Event x1 received Data: x1 xf7 x10 x0 x0 x0 0
[   10.464599]  sda: sda1 sda2
[   10.481480] sd 0:1:0:0: [sda] Attached SCSI disk
[  OK  ] Found device /dev/mapper/rhel-root.
         Starting File System Check on /dev/mapper/rhel-root...
[  OK  ] Started File System Check on /dev/mapper/rhel-root.
..
,,

Laurence Oberman
Principal Software Maintenance Engineer
Red Hat Global Support Services

----- Original Message -----
From: "Laurence Oberman" <loberman@redhat.com>
To: "Hannes Reinecke" <hare@suse.de>
Cc: "Bart Van Assche" <bart.vanassche@sandisk.com>, "Martin K. Petersen" <martin.petersen@oracle.com>, "Christoph Hellwig" <hch@lst.de>, "James Bottomley" <james.bottomley@hansenpartnership.com>, linux-scsi@vger.kernel.org
Sent: Monday, March 21, 2016 4:40:57 PM
Subject: Re: [PATCHv3] scsi: disable automatic target scan

Hello Hannes

Please share latest scripts and an example of how you are using them.
I have some scripts from last November, that you posted but I am sure they have changed.
If not then I will modify them as appropriate, just let me know.

I have added the patches and booted the system set to async, so before I boot with scsi_mod.scan=manual want to prepare my test system.
This feature may be a very useful feature we would want to include in RHEL as we struggle with large LUN boot configurations all the time.
When you have time and thanks

Laurence Oberman
Principal Software Maintenance Engineer
Red Hat Global Support Services

----- Original Message -----
From: "Hannes Reinecke" <hare@suse.de>
To: "Bart Van Assche" <bart.vanassche@sandisk.com>, "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: "Christoph Hellwig" <hch@lst.de>, "James Bottomley" <james.bottomley@hansenpartnership.com>, linux-scsi@vger.kernel.org
Sent: Monday, March 21, 2016 3:15:10 AM
Subject: Re: [PATCHv3] scsi: disable automatic target scan

On 03/21/2016 02:24 AM, Bart Van Assche wrote:
> On 03/19/16 08:18, Hannes Reinecke wrote:
>> On 03/18/2016 10:56 PM, Bart Van Assche wrote:
>>> On 03/17/2016 12:39 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.
>>>
>>> Hello Hannes,
>>>
>>> Will setting scsi_scan_type to 'manual' allow a system to boot
>>> from a
>>> SCSI disk? If not, are there alternatives to this approach? Would
>>> it be
>>> a valid alternative to e.g. introduce a new threshold parameter such
>>> that only LUN numbers below this threshold are scanned during boot?
>>>
>> I have a patch for dracut, which will generate udev rules for all
>> devices required for mounting the root fs.
>> Once the system is booted properly I've got another patch for systemd
>> which switches back to 'normal' scanning (ie by writing 'sync' into
>> /sys/modules/scsi_mod/parameters/scan) and rescan all scsi hosts.
>>
>> With that there's no need to have any arbitrary limits; only the
>> necessary devices are enabled during boot.
> 
> Hello Hannes,
> 
> That sounds like a really interesting approach. Will this approach
> also work if the SCSI host and/or LUN numbers change during a reboot?
> 
It's independent on the SCSI host as it just looks for the rport ID
(FC WWPN, SAS ID, or iSCSI target name). The LUN number, however, is
fixed; the whole point of this exercise is that you want to blank
out individual LUNs behind a given target.
Hence you need to able to address the LUNs in the first place.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCHv3] scsi: disable automatic target scan
  2016-03-17  7:39 [PATCHv3] scsi: disable automatic target scan Hannes Reinecke
  2016-03-18 19:39 ` Ewan D. Milne
  2016-03-18 21:56 ` Bart Van Assche
@ 2016-03-29  0:27 ` Martin K. Petersen
  2016-03-30 19:41 ` Benjamin Block
  3 siblings, 0 replies; 14+ messages in thread
From: Martin K. Petersen @ 2016-03-29  0:27 UTC (permalink / raw)
  To: Hannes Reinecke
  Cc: Martin K. Petersen, Christoph Hellwig, James Bottomley, linux-scsi

>>>>> "Hannes" == Hannes Reinecke <hare@suse.de> writes:

Hannes> On larger installations it is useful to disable automatic LUN
Hannes> scanning, and only add the required LUNs via udev rules.  This
Hannes> can speed up bootup dramatically.

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

Applied to 4.7/scsi-queue.

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* Re: [PATCHv3] scsi: disable automatic target scan
  2016-03-17  7:39 [PATCHv3] scsi: disable automatic target scan Hannes Reinecke
                   ` (2 preceding siblings ...)
  2016-03-29  0:27 ` Martin K. Petersen
@ 2016-03-30 19:41 ` Benjamin Block
  2016-04-01  7:29   ` Hannes Reinecke
  3 siblings, 1 reply; 14+ messages in thread
From: Benjamin Block @ 2016-03-30 19:41 UTC (permalink / raw)
  To: Hannes Reinecke
  Cc: Martin K. Petersen, Christoph Hellwig, James Bottomley, linux-scsi

Hello Hannes,

I am a bit late here, but as this got pulled and Steffen didn't have
time to give it a review, I did today.

On 08:39 Thu 17 Mar     , 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@suse.de>
> ---

[:snip:]

> 
> diff --git a/drivers/s390/scsi/zfcp_unit.c b/drivers/s390/scsi/zfcp_unit.c
> index 157d3d2..08bba7c 100644
> --- a/drivers/s390/scsi/zfcp_unit.c
> +++ b/drivers/s390/scsi/zfcp_unit.c
> @@ -26,7 +26,8 @@ void zfcp_unit_scsi_scan(struct zfcp_unit *unit)
>  	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_RESCAN);

I'd rather use the new SCSI_SCAN_MANUAL here. We don't want this to be
"blocked" by an attribute set in a different (new) code-path and
config-location.

This path is used by both, zfcp-recovery and -userinterfaces (sysfs) and
in both cases we call it with the intend that the scan is really done -
hence the SCSI_SCAN_MANUAL to force a scan. I'd find it very weird if
suddenly our users would have to additionally use yet an other config to
get the old interfaces working properly.



                                                    Beste Grüße / Best regards,
                                                      - Benjamin Block
-- 
Linux on z Systems Development         /         IBM Systems & Technology Group
		  IBM Deutschland Research & Development GmbH 
Vorsitz. AufsR.: Martina Koederitz     /        Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen / Registergericht: AmtsG Stuttgart, HRB 243294

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

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

* Re: [PATCHv3] scsi: disable automatic target scan
  2016-03-30 19:41 ` Benjamin Block
@ 2016-04-01  7:29   ` Hannes Reinecke
  2016-04-05 12:20     ` Benjamin Block
  0 siblings, 1 reply; 14+ messages in thread
From: Hannes Reinecke @ 2016-04-01  7:29 UTC (permalink / raw)
  To: Benjamin Block
  Cc: Martin K. Petersen, Christoph Hellwig, James Bottomley, linux-scsi

On 03/30/2016 09:41 PM, Benjamin Block wrote:
> Hello Hannes,
> 
> I am a bit late here, but as this got pulled and Steffen didn't have
> time to give it a review, I did today.
> 
> On 08:39 Thu 17 Mar     , 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@suse.de>
>> ---
> 
> [:snip:]
> 
>>
>> diff --git a/drivers/s390/scsi/zfcp_unit.c b/drivers/s390/scsi/zfcp_unit.c
>> index 157d3d2..08bba7c 100644
>> --- a/drivers/s390/scsi/zfcp_unit.c
>> +++ b/drivers/s390/scsi/zfcp_unit.c
>> @@ -26,7 +26,8 @@ void zfcp_unit_scsi_scan(struct zfcp_unit *unit)
>>  	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_RESCAN);
> 
> I'd rather use the new SCSI_SCAN_MANUAL here. We don't want this to be
> "blocked" by an attribute set in a different (new) code-path and
> config-location.
> 
> This path is used by both, zfcp-recovery and -userinterfaces (sysfs) and
> in both cases we call it with the intend that the scan is really done -
> hence the SCSI_SCAN_MANUAL to force a scan. I'd find it very weird if
> suddenly our users would have to additionally use yet an other config to
> get the old interfaces working properly.
> 
Okay, no problem with that.
zfcp has its own scanning rules (cf allow_lun_scan module parameter), so
setting it to 'MANUAL' will just restore the original behaviour.

Will you be sending a patch for it?

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		      zSeries & Storage
hare@suse.de			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCHv3] scsi: disable automatic target scan
  2016-04-01  7:29   ` Hannes Reinecke
@ 2016-04-05 12:20     ` Benjamin Block
  0 siblings, 0 replies; 14+ messages in thread
From: Benjamin Block @ 2016-04-05 12:20 UTC (permalink / raw)
  To: Hannes Reinecke
  Cc: Martin K. Petersen, Christoph Hellwig, James Bottomley, linux-scsi

On 09:29 Fri 01 Apr     , Hannes Reinecke wrote:
> On 03/30/2016 09:41 PM, Benjamin Block wrote:
> > Hello Hannes,
> > 
> > I am a bit late here, but as this got pulled and Steffen didn't have
> > time to give it a review, I did today.
> > 
> > On 08:39 Thu 17 Mar     , 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@suse.de>
> >> ---
> > 
> > [:snip:]
> > 
> >>
> >> diff --git a/drivers/s390/scsi/zfcp_unit.c b/drivers/s390/scsi/zfcp_unit.c
> >> index 157d3d2..08bba7c 100644
> >> --- a/drivers/s390/scsi/zfcp_unit.c
> >> +++ b/drivers/s390/scsi/zfcp_unit.c
> >> @@ -26,7 +26,8 @@ void zfcp_unit_scsi_scan(struct zfcp_unit *unit)
> >>  	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_RESCAN);
> > 
> > I'd rather use the new SCSI_SCAN_MANUAL here. We don't want this to be
> > "blocked" by an attribute set in a different (new) code-path and
> > config-location.
> > 
> > This path is used by both, zfcp-recovery and -userinterfaces (sysfs) and
> > in both cases we call it with the intend that the scan is really done -
> > hence the SCSI_SCAN_MANUAL to force a scan. I'd find it very weird if
> > suddenly our users would have to additionally use yet an other config to
> > get the old interfaces working properly.
> > 
> Okay, no problem with that.
> zfcp has its own scanning rules (cf allow_lun_scan module parameter), so
> setting it to 'MANUAL' will just restore the original behaviour.
> 
> Will you be sending a patch for it?
> 

Yeah, sry, once I am through our backlog and I find time to test that
properly.



                                                    Beste Grüße / Best regards,
                                                      - Benjamin Block
-- 
Linux on z Systems Development         /         IBM Systems & Technology Group
		  IBM Deutschland Research & Development GmbH 
Vorsitz. AufsR.: Martina Koederitz     /        Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen / Registergericht: AmtsG Stuttgart, HRB 243294

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

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

end of thread, other threads:[~2016-04-05 12:20 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-17  7:39 [PATCHv3] scsi: disable automatic target scan Hannes Reinecke
2016-03-18 19:39 ` Ewan D. Milne
2016-03-18 21:56 ` Bart Van Assche
2016-03-19 15:18   ` Hannes Reinecke
2016-03-19 15:29     ` Laurence Oberman
2016-03-21  1:24     ` Bart Van Assche
2016-03-21  7:15       ` Hannes Reinecke
2016-03-21 20:40         ` Laurence Oberman
2016-03-22 17:36           ` Hannes Reinecke
2016-03-24  2:35           ` Laurence Oberman
2016-03-29  0:27 ` Martin K. Petersen
2016-03-30 19:41 ` Benjamin Block
2016-04-01  7:29   ` Hannes Reinecke
2016-04-05 12:20     ` Benjamin Block

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.