All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] [SCSI] Only blacklist WRITE SAME for VMware virtual disks
@ 2014-12-04  2:18 Martin K. Petersen
  2014-12-04  2:18 ` [PATCH 2/4] [SCSI] Blacklist RSOC for Microsoft iSCSI target devices Martin K. Petersen
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Martin K. Petersen @ 2014-12-04  2:18 UTC (permalink / raw)
  To: linux-scsi; +Cc: Martin K. Petersen, stable

Commit 4089b71cc820 blacklisted WRITE SAME for all VMware disks.
However, the WRITE SAME commands are supported for passthrough
disks. Change the heuristic so we only blacklist virtual disks.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Reported-by: Petr Vandrovec <petr@vmware.com>
Tested-by: Chris J Arges <chris.j.arges@canonical.com>
Cc: stable@vger.kernel.org # v3.18
---
 drivers/message/fusion/mptspi.c | 5 -----
 drivers/scsi/scsi_devinfo.c     | 2 ++
 drivers/scsi/scsi_scan.c        | 3 +++
 include/scsi/scsi_devinfo.h     | 1 +
 4 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c
index 613231c16194..787933d43d32 100644
--- a/drivers/message/fusion/mptspi.c
+++ b/drivers/message/fusion/mptspi.c
@@ -1419,11 +1419,6 @@ mptspi_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 		goto out_mptspi_probe;
         }
 
-	/* VMWare emulation doesn't properly implement WRITE_SAME
-	 */
-	if (pdev->subsystem_vendor == 0x15AD)
-		sh->no_write_same = 1;
-
 	spin_lock_irqsave(&ioc->FreeQlock, flags);
 
 	/* Attach the SCSI Host to the IOC structure
diff --git a/drivers/scsi/scsi_devinfo.c b/drivers/scsi/scsi_devinfo.c
index 49014a143c6a..8c228e049bb6 100644
--- a/drivers/scsi/scsi_devinfo.c
+++ b/drivers/scsi/scsi_devinfo.c
@@ -249,6 +249,8 @@ static struct {
 	{"TOSHIBA", "CD-ROM", NULL, BLIST_ISROM},
 	{"Traxdata", "CDR4120", NULL, BLIST_NOLUN},	/* locks up */
 	{"USB2.0", "SMARTMEDIA/XD", NULL, BLIST_FORCELUN | BLIST_INQUIRY_36},
+	{"VMware", "Virtual disk", "1.0", BLIST_NO_WRITE_SAME }, /* ESX */
+	{"VMware,", "VMware Virtual S", "1.0", BLIST_NO_WRITE_SAME }, /* WS,Fusion */
 	{"WangDAT", "Model 2600", "01.7", BLIST_SELECT_NO_ATN},
 	{"WangDAT", "Model 3200", "02.2", BLIST_SELECT_NO_ATN},
 	{"WangDAT", "Model 1300", "02.4", BLIST_SELECT_NO_ATN},
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 0cda53adfd35..0dd31752796a 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -963,6 +963,9 @@ static int scsi_add_lun(struct scsi_device *sdev, unsigned char *inq_result,
 	if (*bflags & BLIST_NO_DIF)
 		sdev->no_dif = 1;
 
+	if (*bflags & BLIST_NO_WRITE_SAME)
+		sdev->no_write_same = 1;
+
 	sdev->eh_timeout = SCSI_DEFAULT_EH_TIMEOUT;
 
 	if (*bflags & BLIST_TRY_VPD_PAGES)
diff --git a/include/scsi/scsi_devinfo.h b/include/scsi/scsi_devinfo.h
index 183eaab7c380..1a24efb4b1d6 100644
--- a/include/scsi/scsi_devinfo.h
+++ b/include/scsi/scsi_devinfo.h
@@ -36,5 +36,6 @@
 					     for sequential scan */
 #define BLIST_TRY_VPD_PAGES	0x10000000 /* Attempt to read VPD pages */
 #define BLIST_NO_RSOC		0x20000000 /* don't try to issue RSOC */
+#define BLIST_NO_WRITE_SAME	0x40000000 /* don't try to issue WRITE SAME */
 
 #endif
-- 
1.9.3

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

* [PATCH 2/4] [SCSI] Blacklist RSOC for Microsoft iSCSI target devices
  2014-12-04  2:18 [PATCH 1/4] [SCSI] Only blacklist WRITE SAME for VMware virtual disks Martin K. Petersen
@ 2014-12-04  2:18 ` Martin K. Petersen
  2014-12-05  1:24   ` Mike Christie
  2014-12-15 13:47   ` Christoph Hellwig
  2014-12-04  2:18 ` [PATCH 3/4] [SCSI] sd: Sanity check the optimal I/O size Martin K. Petersen
  2014-12-04  2:18 ` [PATCH 4/4] [SCSI] Remove VPD quirk for Seagate drives Martin K. Petersen
  2 siblings, 2 replies; 8+ messages in thread
From: Martin K. Petersen @ 2014-12-04  2:18 UTC (permalink / raw)
  To: linux-scsi; +Cc: Martin K. Petersen, Mike Christie, stable

The Microsoft iSCSI target does not support REPORT SUPPORTED OPERATION
CODES. Blacklist these devices so we don't attempt to send the command.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Reported-by: jazz@deti74.ru
Cc: Mike Christie <michaelc@cs.wisc.edu>
Cc: stable@vger.kernel.org # v3.10+
---
 drivers/scsi/scsi_devinfo.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/scsi_devinfo.c b/drivers/scsi/scsi_devinfo.c
index 8c228e049bb6..db42c37e1230 100644
--- a/drivers/scsi/scsi_devinfo.c
+++ b/drivers/scsi/scsi_devinfo.c
@@ -210,6 +210,7 @@ static struct {
 	{"Medion", "Flash XL  MMC/SD", "2.6D", BLIST_FORCELUN},
 	{"MegaRAID", "LD", NULL, BLIST_FORCELUN},
 	{"MICROP", "4110", NULL, BLIST_NOTQ},
+	{"MSFT", "Virtual HD", NULL, BLIST_NO_RSOC},
 	{"MYLEX", "DACARMRB", "*", BLIST_REPORTLUN2},
 	{"nCipher", "Fastness Crypto", NULL, BLIST_FORCELUN},
 	{"NAKAMICH", "MJ-4.8S", NULL, BLIST_FORCELUN | BLIST_SINGLELUN},
-- 
1.9.3


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

* [PATCH 3/4] [SCSI] sd: Sanity check the optimal I/O size
  2014-12-04  2:18 [PATCH 1/4] [SCSI] Only blacklist WRITE SAME for VMware virtual disks Martin K. Petersen
  2014-12-04  2:18 ` [PATCH 2/4] [SCSI] Blacklist RSOC for Microsoft iSCSI target devices Martin K. Petersen
@ 2014-12-04  2:18 ` Martin K. Petersen
  2014-12-04  2:18 ` [PATCH 4/4] [SCSI] Remove VPD quirk for Seagate drives Martin K. Petersen
  2 siblings, 0 replies; 8+ messages in thread
From: Martin K. Petersen @ 2014-12-04  2:18 UTC (permalink / raw)
  To: linux-scsi; +Cc: Martin K. Petersen, stable

We have come across a couple of devices that report crackpot values in
the optimal I/O size in the Block Limits VPD page. Since this is a
32-bit entity that gets multiplied by the logical block size we can get
disproportionately large values reported to the block layer.

Cap io_opt at 256 MB.

Reported-by: Chris Friesen <chris.friesen@windriver.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Cc: stable@vger.kernel.org
---
 drivers/scsi/sd.c | 3 ++-
 drivers/scsi/sd.h | 9 +++++----
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index fedab3c21ddf..127e8978fde1 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -2593,7 +2593,8 @@ static void sd_read_block_limits(struct scsi_disk *sdkp)
 	blk_queue_io_min(sdkp->disk->queue,
 			 get_unaligned_be16(&buffer[6]) * sector_sz);
 	blk_queue_io_opt(sdkp->disk->queue,
-			 get_unaligned_be32(&buffer[12]) * sector_sz);
+			 min_t(unsigned int, SD_MAX_IO_OPT_BYTES,
+			       get_unaligned_be32(&buffer[12]) * sector_sz));
 
 	if (buffer[3] == 0x3c) {
 		unsigned int lba_count, desc_count;
diff --git a/drivers/scsi/sd.h b/drivers/scsi/sd.h
index 63ba5ca7f9a1..f175a3f2944a 100644
--- a/drivers/scsi/sd.h
+++ b/drivers/scsi/sd.h
@@ -44,10 +44,11 @@ enum {
 };
 
 enum {
-	SD_DEF_XFER_BLOCKS = 0xffff,
-	SD_MAX_XFER_BLOCKS = 0xffffffff,
-	SD_MAX_WS10_BLOCKS = 0xffff,
-	SD_MAX_WS16_BLOCKS = 0x7fffff,
+	SD_DEF_XFER_BLOCKS	= 0xffff,
+	SD_MAX_XFER_BLOCKS	= 0xffffffff,
+	SD_MAX_WS10_BLOCKS	= 0xffff,
+	SD_MAX_WS16_BLOCKS	= 0x7fffff,
+	SD_MAX_IO_OPT_BYTES	= 256 * 1024 * 1024,
 };
 
 enum {
-- 
1.9.3

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

* [PATCH 4/4] [SCSI] Remove VPD quirk for Seagate drives
  2014-12-04  2:18 [PATCH 1/4] [SCSI] Only blacklist WRITE SAME for VMware virtual disks Martin K. Petersen
  2014-12-04  2:18 ` [PATCH 2/4] [SCSI] Blacklist RSOC for Microsoft iSCSI target devices Martin K. Petersen
  2014-12-04  2:18 ` [PATCH 3/4] [SCSI] sd: Sanity check the optimal I/O size Martin K. Petersen
@ 2014-12-04  2:18 ` Martin K. Petersen
  2 siblings, 0 replies; 8+ messages in thread
From: Martin K. Petersen @ 2014-12-04  2:18 UTC (permalink / raw)
  To: linux-scsi; +Cc: Martin K. Petersen, stable

Now that we sanity check the optimal I/O size reported by the device we
no longer need to blacklist the VPD pages on certain Seagate drives.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Cc: stable@vger.kernel.org
---
 drivers/scsi/scsi_devinfo.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/scsi/scsi_devinfo.c b/drivers/scsi/scsi_devinfo.c
index db42c37e1230..0f491ab887a4 100644
--- a/drivers/scsi/scsi_devinfo.c
+++ b/drivers/scsi/scsi_devinfo.c
@@ -230,7 +230,6 @@ static struct {
 	{"SanDisk", "ImageMate CF-SD1", NULL, BLIST_FORCELUN},
 	{"SEAGATE", "ST34555N", "0930", BLIST_NOTQ},	/* Chokes on tagged INQUIRY */
 	{"SEAGATE", "ST3390N", "9546", BLIST_NOTQ},
-	{"SEAGATE", "ST900MM0006", NULL, BLIST_SKIP_VPD_PAGES},
 	{"SGI", "RAID3", "*", BLIST_SPARSELUN},
 	{"SGI", "RAID5", "*", BLIST_SPARSELUN},
 	{"SGI", "TP9100", "*", BLIST_REPORTLUN2},
-- 
1.9.3

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

* Re: [PATCH 2/4] [SCSI] Blacklist RSOC for Microsoft iSCSI target devices
  2014-12-04  2:18 ` [PATCH 2/4] [SCSI] Blacklist RSOC for Microsoft iSCSI target devices Martin K. Petersen
@ 2014-12-05  1:24   ` Mike Christie
  2014-12-05  2:17     ` Martin K. Petersen
  2014-12-15 13:47   ` Christoph Hellwig
  1 sibling, 1 reply; 8+ messages in thread
From: Mike Christie @ 2014-12-05  1:24 UTC (permalink / raw)
  To: Martin K. Petersen; +Cc: linux-scsi, stable

On 12/3/14, 8:18 PM, Martin K. Petersen wrote:
> The Microsoft iSCSI target does not support REPORT SUPPORTED OPERATION
> CODES. Blacklist these devices so we don't attempt to send the command.
>
> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
> Reported-by: jazz@deti74.ru
> Cc: Mike Christie <michaelc@cs.wisc.edu>
> Cc: stable@vger.kernel.org # v3.10+
> ---
>   drivers/scsi/scsi_devinfo.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/scsi/scsi_devinfo.c b/drivers/scsi/scsi_devinfo.c
> index 8c228e049bb6..db42c37e1230 100644
> --- a/drivers/scsi/scsi_devinfo.c
> +++ b/drivers/scsi/scsi_devinfo.c
> @@ -210,6 +210,7 @@ static struct {
>   	{"Medion", "Flash XL  MMC/SD", "2.6D", BLIST_FORCELUN},
>   	{"MegaRAID", "LD", NULL, BLIST_FORCELUN},
>   	{"MICROP", "4110", NULL, BLIST_NOTQ},
> +	{"MSFT", "Virtual HD", NULL, BLIST_NO_RSOC},
>   	{"MYLEX", "DACARMRB", "*", BLIST_REPORTLUN2},
>   	{"nCipher", "Fastness Crypto", NULL, BLIST_FORCELUN},
>   	{"NAKAMICH", "MJ-4.8S", NULL, BLIST_FORCELUN | BLIST_SINGLELUN},
>

Thanks Martin.

Tested-by: Mike Christie <michaelc@cs.wisc.edu>

In case other people test this patch, I wanted to warn people that the 
MS iSCSI target does the same sequence (sends reject PDU then drops the 
connection on us) for any command it does not support. We end up seeing 
the same problem for other commands. For example, some distros have 
tools that send CDB 0x85 during initialization, and the MS target will 
fail on that in the same way we saw here.

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

* Re: [PATCH 2/4] [SCSI] Blacklist RSOC for Microsoft iSCSI target devices
  2014-12-05  1:24   ` Mike Christie
@ 2014-12-05  2:17     ` Martin K. Petersen
  2014-12-05 16:59       ` Mike Christie
  0 siblings, 1 reply; 8+ messages in thread
From: Martin K. Petersen @ 2014-12-05  2:17 UTC (permalink / raw)
  To: Mike Christie; +Cc: Martin K. Petersen, linux-scsi

>>>>> "Mike" == Mike Christie <michaelc@cs.wisc.edu> writes:

Mike> In case other people test this patch, I wanted to warn people that
Mike> the MS iSCSI target does the same sequence (sends reject PDU then
Mike> drops the connection on us) for any command it does not
Mike> support. We end up seeing the same problem for other commands.

Ick. Have you pinged MS about this again recently? Doesn't sound like
we'd be the only ones tripping over something like this.

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* Re: [PATCH 2/4] [SCSI] Blacklist RSOC for Microsoft iSCSI target devices
  2014-12-05  2:17     ` Martin K. Petersen
@ 2014-12-05 16:59       ` Mike Christie
  0 siblings, 0 replies; 8+ messages in thread
From: Mike Christie @ 2014-12-05 16:59 UTC (permalink / raw)
  To: Martin K. Petersen; +Cc: linux-scsi

On 12/4/14, 8:17 PM, Martin K. Petersen wrote:
>>>>>> "Mike" == Mike Christie <michaelc@cs.wisc.edu> writes:
>
> Mike> In case other people test this patch, I wanted to warn people that
> Mike> the MS iSCSI target does the same sequence (sends reject PDU then
> Mike> drops the connection on us) for any command it does not
> Mike> support. We end up seeing the same problem for other commands.
>
> Ick. Have you pinged MS about this again recently? Doesn't sound like
> we'd be the only ones tripping over something like this.

I have not. Until the other day in this thread, I thought they fixed it 
in the newer target versions. I just noticed this behavior was the 
general error handling behavior for all unknown commands yesterday when 
testing your patch. Trying to write up an analysis about why they should 
return a ILLEGAL REQUEST and not drop the connection for unsupported 
commands.

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

* Re: [PATCH 2/4] [SCSI] Blacklist RSOC for Microsoft iSCSI target devices
  2014-12-04  2:18 ` [PATCH 2/4] [SCSI] Blacklist RSOC for Microsoft iSCSI target devices Martin K. Petersen
  2014-12-05  1:24   ` Mike Christie
@ 2014-12-15 13:47   ` Christoph Hellwig
  1 sibling, 0 replies; 8+ messages in thread
From: Christoph Hellwig @ 2014-12-15 13:47 UTC (permalink / raw)
  To: Martin K. Petersen; +Cc: linux-scsi, Mike Christie

Thanks, applied to core-for-3.19.  Any chance to get reviews for the
other patches?

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

end of thread, other threads:[~2014-12-15 13:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-04  2:18 [PATCH 1/4] [SCSI] Only blacklist WRITE SAME for VMware virtual disks Martin K. Petersen
2014-12-04  2:18 ` [PATCH 2/4] [SCSI] Blacklist RSOC for Microsoft iSCSI target devices Martin K. Petersen
2014-12-05  1:24   ` Mike Christie
2014-12-05  2:17     ` Martin K. Petersen
2014-12-05 16:59       ` Mike Christie
2014-12-15 13:47   ` Christoph Hellwig
2014-12-04  2:18 ` [PATCH 3/4] [SCSI] sd: Sanity check the optimal I/O size Martin K. Petersen
2014-12-04  2:18 ` [PATCH 4/4] [SCSI] Remove VPD quirk for Seagate drives Martin K. Petersen

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.