All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] storvsc: workaround for virtual DVD SCSI version
@ 2017-03-07 17:15 ` Stephen Hemminger
  0 siblings, 0 replies; 10+ messages in thread
From: Stephen Hemminger @ 2017-03-07 17:15 UTC (permalink / raw)
  To: kys, haiyangz, longli, martin.petersen, hch, hare
  Cc: linux-scsi, linux-kernel, devel, Stephen Hemminger

Hyper-V host emulation of SCSI for virtual DVD device reports SCSI
version 0 (UNKNOWN) but is still capable of supporting REPORTLUN. 

Without this patch, a GEN2 Linux guest on Hyper-V will not boot 4.11
successfully with virtual DVD ROM device. What happens is that the
SCSI scan process falls back to doing sequential probing by INQUIRY.
But the storvsc driver has a previous workaround that masks/blocks all
errors reports from INQUIRY (or MODE_SENSE) commands.  This workaround
causes the scan to then populate a full set of bogus LUN's on the
target and then sends kernel spinning off into a death spiral doing
block reads on the non-existent LUNs.

By setting the correct blacklist flags, the target with the
DVD device is scanned with REPORTLUN and that works correctly.

Patch needs to go in current 4.11, it is safe but not necessary
in older kernels.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
---
 drivers/scsi/storvsc_drv.c | 27 +++++++++++++++++----------
 1 file changed, 17 insertions(+), 10 deletions(-)

PS: The error handling does need to be fixed (have patches pending)
but that is interrelated with hotplug and can wait.

diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index 638e5f427c90..19973e874830 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -400,8 +400,6 @@ MODULE_PARM_DESC(storvsc_vcpus_per_sub_channel, "Ratio of VCPUs to subchannels")
  */
 static int storvsc_timeout = 180;
 
-static int msft_blist_flags = BLIST_TRY_VPD_PAGES;
-
 #if IS_ENABLED(CONFIG_SCSI_FC_ATTRS)
 static struct scsi_transport_template *fc_transport_template;
 #endif
@@ -1383,6 +1381,22 @@ static int storvsc_do_io(struct hv_device *device,
 	return ret;
 }
 
+static int storvsc_device_alloc(struct scsi_device *sdevice)
+{
+	/*
+	 * Set blist flag to permit the reading of the VPD pages even when
+	 * the target may claim SPC-2 compliance. MSFT targets currently
+	 * claim SPC-2 compliance while they implement post SPC-2 features.
+	 * With this flag we can correctly handle WRITE_SAME_16 issues.
+	 *
+	 * Hypervisor reports SCSI_UNKNOWN type for DVD ROM device but
+	 * still supports REPORT LUN.
+	 */
+	sdevice->sdev_bflags = BLIST_REPORTLUN2 | BLIST_TRY_VPD_PAGES;
+
+	return 0;
+}
+
 static int storvsc_device_configure(struct scsi_device *sdevice)
 {
 
@@ -1396,14 +1410,6 @@ static int storvsc_device_configure(struct scsi_device *sdevice)
 	sdevice->no_write_same = 1;
 
 	/*
-	 * Add blist flags to permit the reading of the VPD pages even when
-	 * the target may claim SPC-2 compliance. MSFT targets currently
-	 * claim SPC-2 compliance while they implement post SPC-2 features.
-	 * With this patch we can correctly handle WRITE_SAME_16 issues.
-	 */
-	sdevice->sdev_bflags |= msft_blist_flags;
-
-	/*
 	 * If the host is WIN8 or WIN8 R2, claim conformance to SPC-3
 	 * if the device is a MSFT virtual device.  If the host is
 	 * WIN10 or newer, allow write_same.
@@ -1661,6 +1667,7 @@ static struct scsi_host_template scsi_driver = {
 	.eh_host_reset_handler =	storvsc_host_reset_handler,
 	.proc_name =		"storvsc_host",
 	.eh_timed_out =		storvsc_eh_timed_out,
+	.slave_alloc =		storvsc_device_alloc,
 	.slave_configure =	storvsc_device_configure,
 	.cmd_per_lun =		255,
 	.this_id =		-1,
-- 
2.11.0

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

* [PATCH] storvsc: workaround for virtual DVD SCSI version
@ 2017-03-07 17:15 ` Stephen Hemminger
  0 siblings, 0 replies; 10+ messages in thread
From: Stephen Hemminger @ 2017-03-07 17:15 UTC (permalink / raw)
  To: kys, haiyangz, longli, martin.petersen, hch, hare
  Cc: devel, Stephen Hemminger, linux-kernel, linux-scsi

Hyper-V host emulation of SCSI for virtual DVD device reports SCSI
version 0 (UNKNOWN) but is still capable of supporting REPORTLUN. 

Without this patch, a GEN2 Linux guest on Hyper-V will not boot 4.11
successfully with virtual DVD ROM device. What happens is that the
SCSI scan process falls back to doing sequential probing by INQUIRY.
But the storvsc driver has a previous workaround that masks/blocks all
errors reports from INQUIRY (or MODE_SENSE) commands.  This workaround
causes the scan to then populate a full set of bogus LUN's on the
target and then sends kernel spinning off into a death spiral doing
block reads on the non-existent LUNs.

By setting the correct blacklist flags, the target with the
DVD device is scanned with REPORTLUN and that works correctly.

Patch needs to go in current 4.11, it is safe but not necessary
in older kernels.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
---
 drivers/scsi/storvsc_drv.c | 27 +++++++++++++++++----------
 1 file changed, 17 insertions(+), 10 deletions(-)

PS: The error handling does need to be fixed (have patches pending)
but that is interrelated with hotplug and can wait.

diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index 638e5f427c90..19973e874830 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -400,8 +400,6 @@ MODULE_PARM_DESC(storvsc_vcpus_per_sub_channel, "Ratio of VCPUs to subchannels")
  */
 static int storvsc_timeout = 180;
 
-static int msft_blist_flags = BLIST_TRY_VPD_PAGES;
-
 #if IS_ENABLED(CONFIG_SCSI_FC_ATTRS)
 static struct scsi_transport_template *fc_transport_template;
 #endif
@@ -1383,6 +1381,22 @@ static int storvsc_do_io(struct hv_device *device,
 	return ret;
 }
 
+static int storvsc_device_alloc(struct scsi_device *sdevice)
+{
+	/*
+	 * Set blist flag to permit the reading of the VPD pages even when
+	 * the target may claim SPC-2 compliance. MSFT targets currently
+	 * claim SPC-2 compliance while they implement post SPC-2 features.
+	 * With this flag we can correctly handle WRITE_SAME_16 issues.
+	 *
+	 * Hypervisor reports SCSI_UNKNOWN type for DVD ROM device but
+	 * still supports REPORT LUN.
+	 */
+	sdevice->sdev_bflags = BLIST_REPORTLUN2 | BLIST_TRY_VPD_PAGES;
+
+	return 0;
+}
+
 static int storvsc_device_configure(struct scsi_device *sdevice)
 {
 
@@ -1396,14 +1410,6 @@ static int storvsc_device_configure(struct scsi_device *sdevice)
 	sdevice->no_write_same = 1;
 
 	/*
-	 * Add blist flags to permit the reading of the VPD pages even when
-	 * the target may claim SPC-2 compliance. MSFT targets currently
-	 * claim SPC-2 compliance while they implement post SPC-2 features.
-	 * With this patch we can correctly handle WRITE_SAME_16 issues.
-	 */
-	sdevice->sdev_bflags |= msft_blist_flags;
-
-	/*
 	 * If the host is WIN8 or WIN8 R2, claim conformance to SPC-3
 	 * if the device is a MSFT virtual device.  If the host is
 	 * WIN10 or newer, allow write_same.
@@ -1661,6 +1667,7 @@ static struct scsi_host_template scsi_driver = {
 	.eh_host_reset_handler =	storvsc_host_reset_handler,
 	.proc_name =		"storvsc_host",
 	.eh_timed_out =		storvsc_eh_timed_out,
+	.slave_alloc =		storvsc_device_alloc,
 	.slave_configure =	storvsc_device_configure,
 	.cmd_per_lun =		255,
 	.this_id =		-1,
-- 
2.11.0

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

* RE: [PATCH] storvsc: workaround for virtual DVD SCSI version
  2017-03-07 17:15 ` Stephen Hemminger
@ 2017-03-07 17:19   ` KY Srinivasan
  -1 siblings, 0 replies; 10+ messages in thread
From: KY Srinivasan @ 2017-03-07 17:19 UTC (permalink / raw)
  To: Stephen Hemminger, Haiyang Zhang, Long Li, martin.petersen, hch, hare
  Cc: linux-scsi, linux-kernel, devel, Stephen Hemminger



> -----Original Message-----
> From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> Sent: Tuesday, March 7, 2017 9:16 AM
> To: KY Srinivasan <kys@microsoft.com>; Haiyang Zhang
> <haiyangz@microsoft.com>; Long Li <longli@microsoft.com>;
> martin.petersen@oracle.com; hch@lst.de; hare@suse.de
> Cc: linux-scsi@vger.kernel.org; linux-kernel@vger.kernel.org;
> devel@linuxdriverproject.org; Stephen Hemminger
> <sthemmin@microsoft.com>
> Subject: [PATCH] storvsc: workaround for virtual DVD SCSI version
> 
> Hyper-V host emulation of SCSI for virtual DVD device reports SCSI
> version 0 (UNKNOWN) but is still capable of supporting REPORTLUN.
> 
> Without this patch, a GEN2 Linux guest on Hyper-V will not boot 4.11
> successfully with virtual DVD ROM device. What happens is that the
> SCSI scan process falls back to doing sequential probing by INQUIRY.
> But the storvsc driver has a previous workaround that masks/blocks all
> errors reports from INQUIRY (or MODE_SENSE) commands.  This workaround
> causes the scan to then populate a full set of bogus LUN's on the
> target and then sends kernel spinning off into a death spiral doing
> block reads on the non-existent LUNs.
> 
> By setting the correct blacklist flags, the target with the
> DVD device is scanned with REPORTLUN and that works correctly.
> 
> Patch needs to go in current 4.11, it is safe but not necessary
> in older kernels.
> 
> Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>

Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>
> ---
>  drivers/scsi/storvsc_drv.c | 27 +++++++++++++++++----------
>  1 file changed, 17 insertions(+), 10 deletions(-)
> 
> PS: The error handling does need to be fixed (have patches pending)
> but that is interrelated with hotplug and can wait.
> 
> diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
> index 638e5f427c90..19973e874830 100644
> --- a/drivers/scsi/storvsc_drv.c
> +++ b/drivers/scsi/storvsc_drv.c
> @@ -400,8 +400,6 @@
> MODULE_PARM_DESC(storvsc_vcpus_per_sub_channel, "Ratio of VCPUs to
> subchannels")
>   */
>  static int storvsc_timeout = 180;
> 
> -static int msft_blist_flags = BLIST_TRY_VPD_PAGES;
> -
>  #if IS_ENABLED(CONFIG_SCSI_FC_ATTRS)
>  static struct scsi_transport_template *fc_transport_template;
>  #endif
> @@ -1383,6 +1381,22 @@ static int storvsc_do_io(struct hv_device *device,
>  	return ret;
>  }
> 
> +static int storvsc_device_alloc(struct scsi_device *sdevice)
> +{
> +	/*
> +	 * Set blist flag to permit the reading of the VPD pages even when
> +	 * the target may claim SPC-2 compliance. MSFT targets currently
> +	 * claim SPC-2 compliance while they implement post SPC-2 features.
> +	 * With this flag we can correctly handle WRITE_SAME_16 issues.
> +	 *
> +	 * Hypervisor reports SCSI_UNKNOWN type for DVD ROM device but
> +	 * still supports REPORT LUN.
> +	 */
> +	sdevice->sdev_bflags = BLIST_REPORTLUN2 |
> BLIST_TRY_VPD_PAGES;
> +
> +	return 0;
> +}
> +
>  static int storvsc_device_configure(struct scsi_device *sdevice)
>  {
> 
> @@ -1396,14 +1410,6 @@ static int storvsc_device_configure(struct
> scsi_device *sdevice)
>  	sdevice->no_write_same = 1;
> 
>  	/*
> -	 * Add blist flags to permit the reading of the VPD pages even when
> -	 * the target may claim SPC-2 compliance. MSFT targets currently
> -	 * claim SPC-2 compliance while they implement post SPC-2 features.
> -	 * With this patch we can correctly handle WRITE_SAME_16 issues.
> -	 */
> -	sdevice->sdev_bflags |= msft_blist_flags;
> -
> -	/*
>  	 * If the host is WIN8 or WIN8 R2, claim conformance to SPC-3
>  	 * if the device is a MSFT virtual device.  If the host is
>  	 * WIN10 or newer, allow write_same.
> @@ -1661,6 +1667,7 @@ static struct scsi_host_template scsi_driver = {
>  	.eh_host_reset_handler =	storvsc_host_reset_handler,
>  	.proc_name =		"storvsc_host",
>  	.eh_timed_out =		storvsc_eh_timed_out,
> +	.slave_alloc =		storvsc_device_alloc,
>  	.slave_configure =	storvsc_device_configure,
>  	.cmd_per_lun =		255,
>  	.this_id =		-1,
> --
> 2.11.0

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

* RE: [PATCH] storvsc: workaround for virtual DVD SCSI version
@ 2017-03-07 17:19   ` KY Srinivasan
  0 siblings, 0 replies; 10+ messages in thread
From: KY Srinivasan @ 2017-03-07 17:19 UTC (permalink / raw)
  To: Stephen Hemminger, Haiyang Zhang, Long Li, martin.petersen, hch, hare
  Cc: devel, Stephen Hemminger, linux-kernel, linux-scsi



> -----Original Message-----
> From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> Sent: Tuesday, March 7, 2017 9:16 AM
> To: KY Srinivasan <kys@microsoft.com>; Haiyang Zhang
> <haiyangz@microsoft.com>; Long Li <longli@microsoft.com>;
> martin.petersen@oracle.com; hch@lst.de; hare@suse.de
> Cc: linux-scsi@vger.kernel.org; linux-kernel@vger.kernel.org;
> devel@linuxdriverproject.org; Stephen Hemminger
> <sthemmin@microsoft.com>
> Subject: [PATCH] storvsc: workaround for virtual DVD SCSI version
> 
> Hyper-V host emulation of SCSI for virtual DVD device reports SCSI
> version 0 (UNKNOWN) but is still capable of supporting REPORTLUN.
> 
> Without this patch, a GEN2 Linux guest on Hyper-V will not boot 4.11
> successfully with virtual DVD ROM device. What happens is that the
> SCSI scan process falls back to doing sequential probing by INQUIRY.
> But the storvsc driver has a previous workaround that masks/blocks all
> errors reports from INQUIRY (or MODE_SENSE) commands.  This workaround
> causes the scan to then populate a full set of bogus LUN's on the
> target and then sends kernel spinning off into a death spiral doing
> block reads on the non-existent LUNs.
> 
> By setting the correct blacklist flags, the target with the
> DVD device is scanned with REPORTLUN and that works correctly.
> 
> Patch needs to go in current 4.11, it is safe but not necessary
> in older kernels.
> 
> Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>

Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>
> ---
>  drivers/scsi/storvsc_drv.c | 27 +++++++++++++++++----------
>  1 file changed, 17 insertions(+), 10 deletions(-)
> 
> PS: The error handling does need to be fixed (have patches pending)
> but that is interrelated with hotplug and can wait.
> 
> diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
> index 638e5f427c90..19973e874830 100644
> --- a/drivers/scsi/storvsc_drv.c
> +++ b/drivers/scsi/storvsc_drv.c
> @@ -400,8 +400,6 @@
> MODULE_PARM_DESC(storvsc_vcpus_per_sub_channel, "Ratio of VCPUs to
> subchannels")
>   */
>  static int storvsc_timeout = 180;
> 
> -static int msft_blist_flags = BLIST_TRY_VPD_PAGES;
> -
>  #if IS_ENABLED(CONFIG_SCSI_FC_ATTRS)
>  static struct scsi_transport_template *fc_transport_template;
>  #endif
> @@ -1383,6 +1381,22 @@ static int storvsc_do_io(struct hv_device *device,
>  	return ret;
>  }
> 
> +static int storvsc_device_alloc(struct scsi_device *sdevice)
> +{
> +	/*
> +	 * Set blist flag to permit the reading of the VPD pages even when
> +	 * the target may claim SPC-2 compliance. MSFT targets currently
> +	 * claim SPC-2 compliance while they implement post SPC-2 features.
> +	 * With this flag we can correctly handle WRITE_SAME_16 issues.
> +	 *
> +	 * Hypervisor reports SCSI_UNKNOWN type for DVD ROM device but
> +	 * still supports REPORT LUN.
> +	 */
> +	sdevice->sdev_bflags = BLIST_REPORTLUN2 |
> BLIST_TRY_VPD_PAGES;
> +
> +	return 0;
> +}
> +
>  static int storvsc_device_configure(struct scsi_device *sdevice)
>  {
> 
> @@ -1396,14 +1410,6 @@ static int storvsc_device_configure(struct
> scsi_device *sdevice)
>  	sdevice->no_write_same = 1;
> 
>  	/*
> -	 * Add blist flags to permit the reading of the VPD pages even when
> -	 * the target may claim SPC-2 compliance. MSFT targets currently
> -	 * claim SPC-2 compliance while they implement post SPC-2 features.
> -	 * With this patch we can correctly handle WRITE_SAME_16 issues.
> -	 */
> -	sdevice->sdev_bflags |= msft_blist_flags;
> -
> -	/*
>  	 * If the host is WIN8 or WIN8 R2, claim conformance to SPC-3
>  	 * if the device is a MSFT virtual device.  If the host is
>  	 * WIN10 or newer, allow write_same.
> @@ -1661,6 +1667,7 @@ static struct scsi_host_template scsi_driver = {
>  	.eh_host_reset_handler =	storvsc_host_reset_handler,
>  	.proc_name =		"storvsc_host",
>  	.eh_timed_out =		storvsc_eh_timed_out,
> +	.slave_alloc =		storvsc_device_alloc,
>  	.slave_configure =	storvsc_device_configure,
>  	.cmd_per_lun =		255,
>  	.this_id =		-1,
> --
> 2.11.0

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

* Re: [PATCH] storvsc: workaround for virtual DVD SCSI version
  2017-03-07 17:15 ` Stephen Hemminger
@ 2017-03-07 23:31   ` Christoph Hellwig
  -1 siblings, 0 replies; 10+ messages in thread
From: Christoph Hellwig @ 2017-03-07 23:31 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: kys, haiyangz, longli, martin.petersen, hch, hare, linux-scsi,
	linux-kernel, devel, Stephen Hemminger

Thanks Stephen,

this looks good to me:

Reviewed-by: Christoph Hellwig <hch@lst.de>

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

* Re: [PATCH] storvsc: workaround for virtual DVD SCSI version
@ 2017-03-07 23:31   ` Christoph Hellwig
  0 siblings, 0 replies; 10+ messages in thread
From: Christoph Hellwig @ 2017-03-07 23:31 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: Stephen Hemminger, linux-scsi, martin.petersen, haiyangz,
	linux-kernel, hch, hare, devel

Thanks Stephen,

this looks good to me:

Reviewed-by: Christoph Hellwig <hch@lst.de>

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

* Re: [PATCH] storvsc: workaround for virtual DVD SCSI version
  2017-03-07 17:15 ` Stephen Hemminger
@ 2017-03-08  1:21   ` Martin K. Petersen
  -1 siblings, 0 replies; 10+ messages in thread
From: Martin K. Petersen @ 2017-03-08  1:21 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: kys, haiyangz, longli, martin.petersen, hch, hare, linux-scsi,
	linux-kernel, devel, Stephen Hemminger

>>>>> "Stephen" == Stephen Hemminger <stephen@networkplumber.org> writes:

Stephen,

Stephen> Hyper-V host emulation of SCSI for virtual DVD device reports
Stephen> SCSI version 0 (UNKNOWN) but is still capable of supporting
Stephen> REPORTLUN.

Stephen> Without this patch, a GEN2 Linux guest on Hyper-V will not boot
Stephen> 4.11 successfully with virtual DVD ROM device. What happens is
Stephen> that the SCSI scan process falls back to doing sequential
Stephen> probing by INQUIRY.  But the storvsc driver has a previous
Stephen> workaround that masks/blocks all errors reports from INQUIRY
Stephen> (or MODE_SENSE) commands.  This workaround causes the scan to
Stephen> then populate a full set of bogus LUN's on the target and then
Stephen> sends kernel spinning off into a death spiral doing block reads
Stephen> on the non-existent LUNs.

Stephen> By setting the correct blacklist flags, the target with the DVD
Stephen> device is scanned with REPORTLUN and that works correctly.

Applied to 4.11/scsi-fixes. Thank you!

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* Re: [PATCH] storvsc: workaround for virtual DVD SCSI version
@ 2017-03-08  1:21   ` Martin K. Petersen
  0 siblings, 0 replies; 10+ messages in thread
From: Martin K. Petersen @ 2017-03-08  1:21 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: Stephen Hemminger, linux-scsi, martin.petersen, haiyangz,
	linux-kernel, hch, hare, devel

>>>>> "Stephen" == Stephen Hemminger <stephen@networkplumber.org> writes:

Stephen,

Stephen> Hyper-V host emulation of SCSI for virtual DVD device reports
Stephen> SCSI version 0 (UNKNOWN) but is still capable of supporting
Stephen> REPORTLUN.

Stephen> Without this patch, a GEN2 Linux guest on Hyper-V will not boot
Stephen> 4.11 successfully with virtual DVD ROM device. What happens is
Stephen> that the SCSI scan process falls back to doing sequential
Stephen> probing by INQUIRY.  But the storvsc driver has a previous
Stephen> workaround that masks/blocks all errors reports from INQUIRY
Stephen> (or MODE_SENSE) commands.  This workaround causes the scan to
Stephen> then populate a full set of bogus LUN's on the target and then
Stephen> sends kernel spinning off into a death spiral doing block reads
Stephen> on the non-existent LUNs.

Stephen> By setting the correct blacklist flags, the target with the DVD
Stephen> device is scanned with REPORTLUN and that works correctly.

Applied to 4.11/scsi-fixes. Thank you!

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* Re: [PATCH] storvsc: workaround for virtual DVD SCSI version
  2017-03-07 17:15 ` Stephen Hemminger
@ 2017-03-08  7:00   ` Hannes Reinecke
  -1 siblings, 0 replies; 10+ messages in thread
From: Hannes Reinecke @ 2017-03-08  7:00 UTC (permalink / raw)
  To: Stephen Hemminger, kys, haiyangz, longli, martin.petersen, hch
  Cc: linux-scsi, linux-kernel, devel, Stephen Hemminger

On 03/07/2017 06:15 PM, Stephen Hemminger wrote:
> Hyper-V host emulation of SCSI for virtual DVD device reports SCSI
> version 0 (UNKNOWN) but is still capable of supporting REPORTLUN. 
> 
> Without this patch, a GEN2 Linux guest on Hyper-V will not boot 4.11
> successfully with virtual DVD ROM device. What happens is that the
> SCSI scan process falls back to doing sequential probing by INQUIRY.
> But the storvsc driver has a previous workaround that masks/blocks all
> errors reports from INQUIRY (or MODE_SENSE) commands.  This workaround
> causes the scan to then populate a full set of bogus LUN's on the
> target and then sends kernel spinning off into a death spiral doing
> block reads on the non-existent LUNs.
> 
> By setting the correct blacklist flags, the target with the
> DVD device is scanned with REPORTLUN and that works correctly.
> 
> Patch needs to go in current 4.11, it is safe but not necessary
> in older kernels.
> 
> Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
> ---
>  drivers/scsi/storvsc_drv.c | 27 +++++++++++++++++----------
>  1 file changed, 17 insertions(+), 10 deletions(-)
> 
> PS: The error handling does need to be fixed (have patches pending)
> but that is interrelated with hotplug and can wait.
> 
Reviewed-by: Hannes Reinecke <hare@suse.com>

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)

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

* Re: [PATCH] storvsc: workaround for virtual DVD SCSI version
@ 2017-03-08  7:00   ` Hannes Reinecke
  0 siblings, 0 replies; 10+ messages in thread
From: Hannes Reinecke @ 2017-03-08  7:00 UTC (permalink / raw)
  To: Stephen Hemminger, kys, haiyangz, longli, martin.petersen, hch
  Cc: devel, Stephen Hemminger, linux-kernel, linux-scsi

On 03/07/2017 06:15 PM, Stephen Hemminger wrote:
> Hyper-V host emulation of SCSI for virtual DVD device reports SCSI
> version 0 (UNKNOWN) but is still capable of supporting REPORTLUN. 
> 
> Without this patch, a GEN2 Linux guest on Hyper-V will not boot 4.11
> successfully with virtual DVD ROM device. What happens is that the
> SCSI scan process falls back to doing sequential probing by INQUIRY.
> But the storvsc driver has a previous workaround that masks/blocks all
> errors reports from INQUIRY (or MODE_SENSE) commands.  This workaround
> causes the scan to then populate a full set of bogus LUN's on the
> target and then sends kernel spinning off into a death spiral doing
> block reads on the non-existent LUNs.
> 
> By setting the correct blacklist flags, the target with the
> DVD device is scanned with REPORTLUN and that works correctly.
> 
> Patch needs to go in current 4.11, it is safe but not necessary
> in older kernels.
> 
> Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
> ---
>  drivers/scsi/storvsc_drv.c | 27 +++++++++++++++++----------
>  1 file changed, 17 insertions(+), 10 deletions(-)
> 
> PS: The error handling does need to be fixed (have patches pending)
> but that is interrelated with hotplug and can wait.
> 
Reviewed-by: Hannes Reinecke <hare@suse.com>

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)

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

end of thread, other threads:[~2017-03-08 10:33 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-07 17:15 [PATCH] storvsc: workaround for virtual DVD SCSI version Stephen Hemminger
2017-03-07 17:15 ` Stephen Hemminger
2017-03-07 17:19 ` KY Srinivasan
2017-03-07 17:19   ` KY Srinivasan
2017-03-07 23:31 ` Christoph Hellwig
2017-03-07 23:31   ` Christoph Hellwig
2017-03-08  1:21 ` Martin K. Petersen
2017-03-08  1:21   ` Martin K. Petersen
2017-03-08  7:00 ` Hannes Reinecke
2017-03-08  7:00   ` Hannes Reinecke

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.