storvsc: fix a bug in storvsc limits
authorK. Y. Srinivasan <kys@microsoft.com>
Tue, 16 Dec 2014 21:21:44 +0000 (13:21 -0800)
committerChristoph Hellwig <hch@lst.de>
Fri, 9 Jan 2015 14:44:26 +0000 (15:44 +0100)
Commit 4cd83ecdac20d30725b4f96e5d7814a1e290bc7e changed the limits to
reflect the values on the host. It turns out that WS2008R2 cannot
correctly handle these new limits. Fix this bug by setting the limits
based on the host.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Reviewed-by: Long Li <longli@microsoft.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/scsi/storvsc_drv.c

index ae8293a388552db2a9982a5cee3681a2b866d098..caa9f0ea217cc902950636a3b8609bc7508f584d 100644 (file)
@@ -1678,6 +1678,9 @@ static int storvsc_probe(struct hv_device *device,
        bool dev_is_ide = ((dev_id->driver_data == IDE_GUID) ? true : false);
        int target = 0;
        struct storvsc_device *stor_device;
+       int max_luns_per_target;
+       int max_targets;
+       int max_channels;
 
        /*
         * Based on the windows host we are running on,
@@ -1691,12 +1694,18 @@ static int storvsc_probe(struct hv_device *device,
                vmscsi_size_delta = sizeof(struct vmscsi_win8_extension);
                vmstor_current_major = VMSTOR_WIN7_MAJOR;
                vmstor_current_minor = VMSTOR_WIN7_MINOR;
+               max_luns_per_target = STORVSC_IDE_MAX_LUNS_PER_TARGET;
+               max_targets = STORVSC_IDE_MAX_TARGETS;
+               max_channels = STORVSC_IDE_MAX_CHANNELS;
                break;
        default:
                sense_buffer_size = POST_WIN7_STORVSC_SENSE_BUFFER_SIZE;
                vmscsi_size_delta = 0;
                vmstor_current_major = VMSTOR_WIN8_MAJOR;
                vmstor_current_minor = VMSTOR_WIN8_MINOR;
+               max_luns_per_target = STORVSC_MAX_LUNS_PER_TARGET;
+               max_targets = STORVSC_MAX_TARGETS;
+               max_channels = STORVSC_MAX_CHANNELS;
                break;
        }
 
@@ -1744,9 +1753,9 @@ static int storvsc_probe(struct hv_device *device,
                break;
 
        case SCSI_GUID:
-               host->max_lun = STORVSC_MAX_LUNS_PER_TARGET;
-               host->max_id = STORVSC_MAX_TARGETS;
-               host->max_channel = STORVSC_MAX_CHANNELS - 1;
+               host->max_lun = max_luns_per_target;
+               host->max_id = max_targets;
+               host->max_channel = max_channels - 1;
                break;
 
        default:
This page took 0.031822 seconds and 5 git commands to generate.