[SLOF] [PATCH] scsi: implement read-capacity-16

Nikunj A Dadhania nikunj at linux.vnet.ibm.com
Mon Oct 10 15:21:04 AEDT 2016


Alexey Kardashevskiy <aik at ozlabs.ru> writes:

> On 23/09/16 04:13, Nikunj A Dadhania wrote:
>> For disks bigger than 2TB(512B sector size), read-capacity-10 would fail
>> and return FFFFFFFF, as it only has 4byte block address field. Detect
>> this and use read-capacity-16 which returns 8byte block address.
>> 
>> Signed-off-by: Nikunj A Dadhania <nikunj at linux.vnet.ibm.com>
>> ---
>>  slof/fs/scsi-disk.fs | 19 +++++++++++++++++++
>>  1 file changed, 19 insertions(+)
>> 
>> diff --git a/slof/fs/scsi-disk.fs b/slof/fs/scsi-disk.fs
>> index 1978471..d4a774b 100644
>> --- a/slof/fs/scsi-disk.fs
>> +++ b/slof/fs/scsi-disk.fs
>> @@ -121,6 +121,20 @@ CREATE cdb 10 allot
>>      drop scratch scsi-get-capacity-10 1 +
>>  ;
>>  
>> +: read-capacity-16 ( -- blocksize #blocks )
>> +    \ Now issue the read-capacity-16 command
>> +    scsi-disk-debug? IF
>> +        ." SCSI-DISK: read-capacity-16 " .s cr
>> +    THEN
>> +    \ Make sure that there are zeros in the buffer in case something goes wrong:
>> +    scratch 20 erase
>
>
> Thanks, applied the version from https://patchwork.ozlabs.org/patch/675736/
> , somehow it have not received it in my mailbox :-/

Hmm.. that is strange, will cc you next time onwards.

Regards
Nikunj



More information about the SLOF mailing list