diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-27 17:54:50 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-27 17:54:50 -0400 |
commit | e494f6333bef20fd9d8689062260c5d0136a3ea0 (patch) | |
tree | faeeef85f8ccabd26ba94fc5a6226f889be2b429 | |
parent | 3bd19078c215d15e20b4447d9c4aa0065813b207 (diff) | |
parent | 0c144d0d0303917000cc918e63567b5ded22d5e2 (diff) |
Merge 'upstream' branch of rsync://rsync.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev
-rw-r--r-- | drivers/scsi/libata-scsi.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c index 7a4adc4c8f09..794fb559efb0 100644 --- a/drivers/scsi/libata-scsi.c +++ b/drivers/scsi/libata-scsi.c | |||
@@ -1176,8 +1176,12 @@ unsigned int ata_scsiop_read_cap(struct ata_scsi_args *args, u8 *rbuf, | |||
1176 | n_sectors = ata_id_u32(args->id, 60); | 1176 | n_sectors = ata_id_u32(args->id, 60); |
1177 | n_sectors--; /* ATA TotalUserSectors - 1 */ | 1177 | n_sectors--; /* ATA TotalUserSectors - 1 */ |
1178 | 1178 | ||
1179 | tmp = n_sectors; /* note: truncates, if lba48 */ | ||
1180 | if (args->cmd->cmnd[0] == READ_CAPACITY) { | 1179 | if (args->cmd->cmnd[0] == READ_CAPACITY) { |
1180 | if( n_sectors >= 0xffffffffULL ) | ||
1181 | tmp = 0xffffffff ; /* Return max count on overflow */ | ||
1182 | else | ||
1183 | tmp = n_sectors ; | ||
1184 | |||
1181 | /* sector count, 32-bit */ | 1185 | /* sector count, 32-bit */ |
1182 | rbuf[0] = tmp >> (8 * 3); | 1186 | rbuf[0] = tmp >> (8 * 3); |
1183 | rbuf[1] = tmp >> (8 * 2); | 1187 | rbuf[1] = tmp >> (8 * 2); |
@@ -1191,10 +1195,12 @@ unsigned int ata_scsiop_read_cap(struct ata_scsi_args *args, u8 *rbuf, | |||
1191 | 1195 | ||
1192 | } else { | 1196 | } else { |
1193 | /* sector count, 64-bit */ | 1197 | /* sector count, 64-bit */ |
1194 | rbuf[2] = n_sectors >> (8 * 7); | 1198 | tmp = n_sectors >> (8 * 4); |
1195 | rbuf[3] = n_sectors >> (8 * 6); | 1199 | rbuf[2] = tmp >> (8 * 3); |
1196 | rbuf[4] = n_sectors >> (8 * 5); | 1200 | rbuf[3] = tmp >> (8 * 2); |
1197 | rbuf[5] = n_sectors >> (8 * 4); | 1201 | rbuf[4] = tmp >> (8 * 1); |
1202 | rbuf[5] = tmp; | ||
1203 | tmp = n_sectors; | ||
1198 | rbuf[6] = tmp >> (8 * 3); | 1204 | rbuf[6] = tmp >> (8 * 3); |
1199 | rbuf[7] = tmp >> (8 * 2); | 1205 | rbuf[7] = tmp >> (8 * 2); |
1200 | rbuf[8] = tmp >> (8 * 1); | 1206 | rbuf[8] = tmp >> (8 * 1); |