Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 22538
b: refs/heads/master
c: 6d73c85
h: refs/heads/master
v: v3
  • Loading branch information
Al Viro authored and James Bottomley committed Feb 28, 2006
1 parent 36f7fe5 commit 4311f03
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fc25307d06f524d6c04b371b236dc9e62186058c
refs/heads/master: 6d73c8514da241c6b1b8d710a6294786604d7142
13 changes: 11 additions & 2 deletions trunk/drivers/scsi/scsi_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1892,8 +1892,16 @@ scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage,
}

if(scsi_status_is_good(result)) {
data->header_length = header_length;
if(use_10_for_ms) {
if (unlikely(buffer[0] == 0x86 && buffer[1] == 0x0b &&
(modepage == 6 || modepage == 8))) {
/* Initio breakage? */
header_length = 0;
data->length = 13;
data->medium_type = 0;
data->device_specific = 0;
data->longlba = 0;
data->block_descriptor_length = 0;
} else if(use_10_for_ms) {
data->length = buffer[0]*256 + buffer[1] + 2;
data->medium_type = buffer[2];
data->device_specific = buffer[3];
Expand All @@ -1906,6 +1914,7 @@ scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage,
data->device_specific = buffer[2];
data->block_descriptor_length = buffer[3];
}
data->header_length = header_length;
}

return result;
Expand Down
6 changes: 6 additions & 0 deletions trunk/drivers/scsi/sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1333,6 +1333,12 @@ sd_read_cache_type(struct scsi_disk *sdkp, char *diskname,
if (!scsi_status_is_good(res))
goto bad_sense;

if (!data.header_length) {
modepage = 6;
printk(KERN_ERR "%s: missing header in MODE_SENSE response\n",
diskname);
}

/* that went OK, now ask for the proper length */
len = data.length;

Expand Down

0 comments on commit 4311f03

Please sign in to comment.