diff options
Diffstat (limited to 'drivers/scsi/scsi_lib.c')
-rw-r--r-- | drivers/scsi/scsi_lib.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 1fe4fd83e305..eab303d148d8 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
@@ -1892,8 +1892,16 @@ scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage, | |||
1892 | } | 1892 | } |
1893 | 1893 | ||
1894 | if(scsi_status_is_good(result)) { | 1894 | if(scsi_status_is_good(result)) { |
1895 | data->header_length = header_length; | 1895 | if (unlikely(buffer[0] == 0x86 && buffer[1] == 0x0b && |
1896 | if(use_10_for_ms) { | 1896 | (modepage == 6 || modepage == 8))) { |
1897 | /* Initio breakage? */ | ||
1898 | header_length = 0; | ||
1899 | data->length = 13; | ||
1900 | data->medium_type = 0; | ||
1901 | data->device_specific = 0; | ||
1902 | data->longlba = 0; | ||
1903 | data->block_descriptor_length = 0; | ||
1904 | } else if(use_10_for_ms) { | ||
1897 | data->length = buffer[0]*256 + buffer[1] + 2; | 1905 | data->length = buffer[0]*256 + buffer[1] + 2; |
1898 | data->medium_type = buffer[2]; | 1906 | data->medium_type = buffer[2]; |
1899 | data->device_specific = buffer[3]; | 1907 | data->device_specific = buffer[3]; |
@@ -1906,6 +1914,7 @@ scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage, | |||
1906 | data->device_specific = buffer[2]; | 1914 | data->device_specific = buffer[2]; |
1907 | data->block_descriptor_length = buffer[3]; | 1915 | data->block_descriptor_length = buffer[3]; |
1908 | } | 1916 | } |
1917 | data->header_length = header_length; | ||
1909 | } | 1918 | } |
1910 | 1919 | ||
1911 | return result; | 1920 | return result; |