On Wed, Jan 30, Olaf Hering wrote:

> Is there a way to not use WRITE_SAME at all? While browsing the code its
> not clear if there is a conditional for this command.

It seems scsi_device->no_write_same may avoid this command, I will
test this patch:

# Subject: [PATCH] scsi: storvsc: avoid usage of WRITE_SAME

Set scsi_device->no_write_same because the host does not support it.
Also blacklist WRITE_SAME to avoid (and log) accident usage.

Signed-off-by: Olaf Hering <o...@aepfle.de>
---
 drivers/scsi/storvsc_drv.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index 0144078..21f788a 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -1155,6 +1155,8 @@ static int storvsc_device_configure(struct scsi_device 
*sdevice)
 
        blk_queue_bounce_limit(sdevice->request_queue, BLK_BOUNCE_ANY);
 
+       sdevice->no_write_same = 1;
+
        return 0;
 }
 
@@ -1241,6 +1243,7 @@ static bool storvsc_scsi_cmd_ok(struct scsi_cmnd *scmnd)
         * smartd sends this command and the host does not handle
         * this. So, don't send it.
         */
+       case WRITE_SAME:
        case SET_WINDOW:
                scmnd->result = ILLEGAL_REQUEST << 16;
                allowed = false;
-- 
1.8.1.1

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

Reply via email to