lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 30 May 2022 01:39:33 -0700
From:   Saurabh Sengar <ssengar@...ux.microsoft.com>
To:     kys@...rosoft.com, haiyangz@...rosoft.com, sthemmin@...rosoft.com,
        wei.liu@...nel.org, decui@...rosoft.com,
        martin.petersen@...cle.com, jejb@...ux.ibm.com,
        linux-hyperv@...r.kernel.org, linux-kernel@...r.kernel.org,
        ssengar@...rosoft.com, mikelley@...rosoft.com
Subject: [PATCH] scsi: storvsc: Enabling WRITE_SAME

This driver already has code logic for WRITE_SAME, but was never working
because of a bug where WRITE_SAME is disabled at scsi controller level.
Apparently if WRITE_SAME is disabled at scsi controller level it takes
precedence over disk level setting. This patch fixes this bug, and enables
this feature only for VMSTOR protocol version 10.0 and above.

Signed-off-by: Saurabh Sengar <ssengar@...ux.microsoft.com>
---
 drivers/scsi/storvsc_drv.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index ca35309..3e55687 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -50,6 +50,7 @@
  * Win8: 5.1
  * Win8.1: 6.0
  * Win10: 6.2
+ * Win10.1: 10.0
  */
 
 #define VMSTOR_PROTO_VERSION(MAJOR_, MINOR_)	((((MAJOR_) & 0xff) << 8) | \
@@ -59,6 +60,7 @@
 #define VMSTOR_PROTO_VERSION_WIN8	VMSTOR_PROTO_VERSION(5, 1)
 #define VMSTOR_PROTO_VERSION_WIN8_1	VMSTOR_PROTO_VERSION(6, 0)
 #define VMSTOR_PROTO_VERSION_WIN10	VMSTOR_PROTO_VERSION(6, 2)
+#define VMSTOR_PROTO_VERSION_WIN10_1	VMSTOR_PROTO_VERSION(10, 0)
 
 /*  Packet structure describing virtual storage requests. */
 enum vstor_packet_operation {
@@ -205,6 +207,7 @@ struct vmscsi_request {
  */
 
 static const int protocol_version[] = {
+		VMSTOR_PROTO_VERSION_WIN10_1,
 		VMSTOR_PROTO_VERSION_WIN10,
 		VMSTOR_PROTO_VERSION_WIN8_1,
 		VMSTOR_PROTO_VERSION_WIN8,
@@ -1558,7 +1561,7 @@ static int storvsc_device_configure(struct scsi_device *sdevice)
 			break;
 		}
 
-		if (vmstor_proto_version >= VMSTOR_PROTO_VERSION_WIN10)
+		if (vmstor_proto_version >= VMSTOR_PROTO_VERSION_WIN10_1)
 			sdevice->no_write_same = 0;
 	}
 
@@ -1845,7 +1848,6 @@ static int storvsc_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *scmnd)
 	.this_id =		-1,
 	/* Ensure there are no gaps in presented sgls */
 	.virt_boundary_mask =	PAGE_SIZE-1,
-	.no_write_same =	1,
 	.track_queue_depth =	1,
 	.change_queue_depth =	storvsc_change_queue_depth,
 };
-- 
1.8.3.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ