devsd: fix scsi emulation for disks bigger than 4 billion sectors (from erik quanstros 9atom)
for read capacity (10 (0x25) if we have more than 4 billion sectors, we must not return nsectors % (1<<32), we must return 0xffffffff.
This commit is contained in:
parent
983413de75
commit
def87d6016
1 changed files with 3 additions and 1 deletions
|
@ -1072,7 +1072,9 @@ sdfakescsi(SDreq *r)
|
|||
* Read capacity returns the LBA of the last sector.
|
||||
*/
|
||||
len = unit->sectors;
|
||||
if(len > 0)
|
||||
if(len >= 0xffffffff)
|
||||
len = 0xffffffff;
|
||||
else if(len > 0)
|
||||
len--;
|
||||
p = r->data;
|
||||
*p++ = len>>24;
|
||||
|
|
Loading…
Reference in a new issue