Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 144462
b: refs/heads/master
c: 8f76d15
h: refs/heads/master
v: v3
  • Loading branch information
Dave Hansen authored and James Bottomley committed Apr 27, 2009
1 parent bbb1542 commit b64d081
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 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: dd406ef8950e76b17d74c5764a1e3d3a87d4a855
refs/heads/master: 8f76d151b010980d137bfdc736d1d8f64b489165
15 changes: 5 additions & 10 deletions trunk/drivers/scsi/sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
#include <linux/string_helpers.h>
#include <linux/async.h>
#include <asm/uaccess.h>
#include <asm/unaligned.h>

#include <scsi/scsi.h>
#include <scsi/scsi_cmnd.h>
Expand Down Expand Up @@ -1344,12 +1345,8 @@ static int read_capacity_16(struct scsi_disk *sdkp, struct scsi_device *sdp,
return -EINVAL;
}

sector_size = (buffer[8] << 24) | (buffer[9] << 16) |
(buffer[10] << 8) | buffer[11];
lba = (((u64)buffer[0] << 56) | ((u64)buffer[1] << 48) |
((u64)buffer[2] << 40) | ((u64)buffer[3] << 32) |
((u64)buffer[4] << 24) | ((u64)buffer[5] << 16) |
((u64)buffer[6] << 8) | (u64)buffer[7]);
sector_size = get_unaligned_be32(&buffer[8]);
lba = get_unaligned_be64(&buffer[0]);

sd_read_protection_type(sdkp, buffer);

Expand Down Expand Up @@ -1400,10 +1397,8 @@ static int read_capacity_10(struct scsi_disk *sdkp, struct scsi_device *sdp,
return -EINVAL;
}

sector_size = (buffer[4] << 24) | (buffer[5] << 16) |
(buffer[6] << 8) | buffer[7];
lba = (buffer[0] << 24) | (buffer[1] << 16) |
(buffer[2] << 8) | buffer[3];
sector_size = get_unaligned_be32(&buffer[4]);
lba = get_unaligned_be32(&buffer[0]);

if ((sizeof(sdkp->capacity) == 4) && (lba == 0xffffffff)) {
sd_printk(KERN_ERR, sdkp, "Too big for this kernel. Use a "
Expand Down

0 comments on commit b64d081

Please sign in to comment.