AHCI - Fix embarassing bug for non-NCQ disk accesses > 128G
authorMatthew Dillon <dillon@apollo.backplane.com>
Thu, 2 Jul 2009 02:46:50 +0000 (19:46 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Thu, 2 Jul 2009 02:46:50 +0000 (19:46 -0700)
Fix an embarassing bug for non-NCQ disk accesses > 128G.  This only
applied to non-NCQ accesses for disks which effectively means disks
behind a PM, since NCQ is generally used everywhere else.  Accesses
for seek positions from 128G to 2TB were wrapping the LBA.

sys/dev/disk/ahci/ahci_cam.c

index 1aab2a6..a18328b 100644 (file)
@@ -1127,7 +1127,7 @@ ahci_xpt_scsi_disk_io(struct ahci_port *ap, struct ata_port *atx,
                        fis->sector_count = xa->tag << 3;
                        fis->features = (u_int8_t)count;
                        fis->features_exp = (u_int8_t)(count >> 8);
-               } else if (count > 0x100 || lba > 0xFFFFFFFFU) {
+               } else if (count > 0x100 || lba > 0x0FFFFFFFU) {
                        /*
                         * Use LBA48
                         */