diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-08-30 00:12:36 +0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-08-30 00:12:36 +0400 |
commit | 2fca877b68b2b4fc5b94277858a1bedd46017cde (patch) | |
tree | fd02725406299ba2f26354463b3c261721e9eb6b /drivers/scsi/libata-scsi.c | |
parent | ff40c6d3d1437ecdf295b8e39adcb06c3d6021ef (diff) | |
parent | 02b3e4e2d71b6058ec11cc01c72ac651eb3ded2b (diff) | |
download | linux-2fca877b68b2b4fc5b94277858a1bedd46017cde.tar.xz |
/spare/repo/libata-dev branch 'v2.6.13'
Diffstat (limited to 'drivers/scsi/libata-scsi.c')
-rw-r--r-- | drivers/scsi/libata-scsi.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c index 5367c10e4db8..954d1bca3b2a 100644 --- a/drivers/scsi/libata-scsi.c +++ b/drivers/scsi/libata-scsi.c @@ -385,6 +385,7 @@ int ata_scsi_error(struct Scsi_Host *host) * appropriate place */ host->host_failed--; + INIT_LIST_HEAD(&host->eh_cmd_q); DPRINTK("EXIT\n"); return 0; @@ -1250,8 +1251,12 @@ unsigned int ata_scsiop_read_cap(struct ata_scsi_args *args, u8 *rbuf, n_sectors--; /* ATA TotalUserSectors - 1 */ - tmp = n_sectors; /* note: truncates, if lba48 */ if (args->cmd->cmnd[0] == READ_CAPACITY) { + if( n_sectors >= 0xffffffffULL ) + tmp = 0xffffffff ; /* Return max count on overflow */ + else + tmp = n_sectors ; + /* sector count, 32-bit */ rbuf[0] = tmp >> (8 * 3); rbuf[1] = tmp >> (8 * 2); @@ -1265,10 +1270,12 @@ unsigned int ata_scsiop_read_cap(struct ata_scsi_args *args, u8 *rbuf, } else { /* sector count, 64-bit */ - rbuf[2] = n_sectors >> (8 * 7); - rbuf[3] = n_sectors >> (8 * 6); - rbuf[4] = n_sectors >> (8 * 5); - rbuf[5] = n_sectors >> (8 * 4); + tmp = n_sectors >> (8 * 4); + rbuf[2] = tmp >> (8 * 3); + rbuf[3] = tmp >> (8 * 2); + rbuf[4] = tmp >> (8 * 1); + rbuf[5] = tmp; + tmp = n_sectors; rbuf[6] = tmp >> (8 * 3); rbuf[7] = tmp >> (8 * 2); rbuf[8] = tmp >> (8 * 1); |