]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.16.3/drivers-scsi-storvsc-fix-a-bug-in-handling-vmbus-protocol-version.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.16.3 / drivers-scsi-storvsc-fix-a-bug-in-handling-vmbus-protocol-version.patch
CommitLineData
033b5a72
GKH
1From adb6f9e1a8c6af1037232b59edb11277471537ea Mon Sep 17 00:00:00 2001
2From: "K. Y. Srinivasan" <kys@microsoft.com>
3Date: Sat, 12 Jul 2014 09:48:29 -0700
4Subject: Drivers: scsi: storvsc: Fix a bug in handling VMBUS protocol version
5
6From: "K. Y. Srinivasan" <kys@microsoft.com>
7
8commit adb6f9e1a8c6af1037232b59edb11277471537ea upstream.
9
10Based on the negotiated VMBUS protocol version, we adjust the size of the storage
11protocol messages. The two sizes we currently handle are pre-win8 and post-win8.
12In WS2012 R2, we are negotiating higher VMBUS protocol version than the win8
13version. Make adjustments to correctly handle this.
14
15Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
16Reviewed-by: Hannes Reinecke <hare@suse.de>
17Signed-off-by: Christoph Hellwig <hch@lst.de>
18Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19
20---
21 drivers/scsi/storvsc_drv.c | 17 ++++++++++-------
22 1 file changed, 10 insertions(+), 7 deletions(-)
23
24--- a/drivers/scsi/storvsc_drv.c
25+++ b/drivers/scsi/storvsc_drv.c
26@@ -1764,19 +1764,22 @@ static int storvsc_probe(struct hv_devic
27 * set state to properly communicate with the host.
28 */
29
30- if (vmbus_proto_version == VERSION_WIN8) {
31- sense_buffer_size = POST_WIN7_STORVSC_SENSE_BUFFER_SIZE;
32- vmscsi_size_delta = 0;
33- vmstor_current_major = VMSTOR_WIN8_MAJOR;
34- vmstor_current_minor = VMSTOR_WIN8_MINOR;
35- } else {
36+ switch (vmbus_proto_version) {
37+ case VERSION_WS2008:
38+ case VERSION_WIN7:
39 sense_buffer_size = PRE_WIN8_STORVSC_SENSE_BUFFER_SIZE;
40 vmscsi_size_delta = sizeof(struct vmscsi_win8_extension);
41 vmstor_current_major = VMSTOR_WIN7_MAJOR;
42 vmstor_current_minor = VMSTOR_WIN7_MINOR;
43+ break;
44+ default:
45+ sense_buffer_size = POST_WIN7_STORVSC_SENSE_BUFFER_SIZE;
46+ vmscsi_size_delta = 0;
47+ vmstor_current_major = VMSTOR_WIN8_MAJOR;
48+ vmstor_current_minor = VMSTOR_WIN8_MINOR;
49+ break;
50 }
51
52-
53 if (dev_id->driver_data == SFC_GUID)
54 scsi_driver.can_queue = (STORVSC_MAX_IO_REQUESTS *
55 STORVSC_FC_MAX_TARGETS);