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:
cinap_lenrek 2013-11-12 20:00:15 +01:00
parent 983413de75
commit def87d6016

View file

@ -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;