]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/scsi/storvsc_drv.c
Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[karo-tx-linux.git] / drivers / scsi / storvsc_drv.c
index 97219a0bb2803d0c14db2d9341a40a35291c2d4b..40c43aeb4ff364898f160d7528d93ea4ef46a00a 100644 (file)
@@ -952,8 +952,10 @@ static int storvsc_channel_init(struct hv_device *device)
        }
 
        if (vstor_packet->operation != VSTOR_OPERATION_COMPLETE_IO ||
-           vstor_packet->status != 0)
+           vstor_packet->status != 0) {
+               ret = -EINVAL;
                goto cleanup;
+       }
 
 
        for (i = 0; i < ARRAY_SIZE(vmstor_protocols); i++) {
@@ -1032,8 +1034,10 @@ static int storvsc_channel_init(struct hv_device *device)
        }
 
        if (vstor_packet->operation != VSTOR_OPERATION_COMPLETE_IO ||
-           vstor_packet->status != 0)
+           vstor_packet->status != 0) {
+               ret = -EINVAL;
                goto cleanup;
+       }
 
        /*
         * Check to see if multi-channel support is there.
@@ -1070,8 +1074,10 @@ static int storvsc_channel_init(struct hv_device *device)
        }
 
        if (vstor_packet->operation != VSTOR_OPERATION_COMPLETE_IO ||
-           vstor_packet->status != 0)
+           vstor_packet->status != 0) {
+               ret = -EINVAL;
                goto cleanup;
+       }
 
        if (process_sub_channels)
                handle_multichannel_storage(device, max_chns);
@@ -1480,7 +1486,8 @@ static int storvsc_device_configure(struct scsi_device *sdevice)
 
        /*
         * If the host is WIN8 or WIN8 R2, claim conformance to SPC-3
-        * if the device is a MSFT virtual device.
+        * if the device is a MSFT virtual device.  If the host is
+        * WIN10 or newer, allow write_same.
         */
        if (!strncmp(sdevice->vendor, "Msft", 4)) {
                switch (vmstor_proto_version) {
@@ -1489,6 +1496,9 @@ static int storvsc_device_configure(struct scsi_device *sdevice)
                        sdevice->scsi_level = SCSI_SPC_3;
                        break;
                }
+
+               if (vmstor_proto_version >= VMSTOR_PROTO_VERSION_WIN10)
+                       sdevice->no_write_same = 0;
        }
 
        return 0;