[stgt] PATCH: Make the check for LBA out of range for READ*/WRITE* better

ronnie sahlberg ronniesahlberg at gmail.com
Sun Jun 3 05:04:56 CEST 2012

On Sun, Jun 3, 2012 at 12:14 PM, FUJITA Tomonori
<fujita.tomonori at lab.ntt.co.jp> wrote:
> On Sun, 3 Jun 2012 10:29:10 +1000
> ronnie sahlberg <ronniesahlberg at gmail.com> wrote:
>> Please find attached a patch that fixes the range check for
>> read*/write* where the transfer length is 0 blocks.
>> For these commands, we still need to check the LBA that it is within a
>> valid range eventhough no actual data is transferred.
> The spec needs that?

I think it does :

>From READ10:

The TRANSFER LENGTH field specifies the number of contiguous logical
blocks of data that shall be read and
transferred to the Data-In Buffer, starting with the logical block
specified by the LOGICAL BLOCK ADDRESS field.
A TRANSFER LENGTH field set to zero specifies that no logical blocks
shall be read. This condition shall not be
considered an error. Any other value specifies the number of logical
blocks that shall be read. If the LBA plus
the transfer length exceeds the capacity of the medium, then the
device server shall terminate the command
with CHECK CONDITION status with the sense key set to ILLEGAL REQUEST
and the additional sense code


I read the "If the LBA plus the  ... exceeds the capacity of the
medium..." as that we should return a check condition here.

ronnie sahlberg
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

More information about the stgt mailing list