ref: 84b8be31d0c9c613d3c98e8db58dd5861ae58cac
parent: 0388ad23395228fc0772343dbe7a294ab6c9d679
author: cinap_lenrek <[email protected]>
date: Sat Feb 11 23:02:33 EST 2012
sdide: fix lba48 transition bug
--- a/sys/src/9/pc/sdide.c
+++ b/sys/src/9/pc/sdide.c
@@ -1275,7 +1275,7 @@
};
enum{
- Last28 = (1<<28) - 1 - 1,
+ Last28 = (1<<28) - 1,
};
static int
@@ -1286,7 +1286,7 @@
int as, c, cmdport, ctlport, h, len, s, use48;
use48 = 0;
- if((drive->flags&Lba48always) || lba > Last28 || drive->count > 256){
+ if((drive->flags&Lba48always) || (lba+drive->count) > Last28 || drive->count > 256){
if((drive->feat & Dllba) == 0)
return -1;
use48 = 1;