mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
target: Add generation of LOGICAL BLOCK ADDRESS OUT OF RANGE
Many SCSI commands are defined to return a CHECK CONDITION / ILLEGAL REQUEST with ASC set to LOGICAL BLOCK ADDRESS OUT OF RANGE if the initiator sends a command that accesses a too-big LBA. Add an enum value and case entries so that target code can return this status. Signed-off-by: Roland Dreier <[email protected]> Cc: [email protected] Signed-off-by: Nicholas Bellinger <[email protected]>
This commit is contained in:
parent
c8045372dd
commit
e2397c7044
2 changed files with 11 additions and 0 deletions
|
|
@ -1640,6 +1640,7 @@ void transport_generic_request_failure(struct se_cmd *cmd)
|
|||
case TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE:
|
||||
case TCM_UNKNOWN_MODE_PAGE:
|
||||
case TCM_WRITE_PROTECTED:
|
||||
case TCM_ADDRESS_OUT_OF_RANGE:
|
||||
case TCM_CHECK_CONDITION_ABORT_CMD:
|
||||
case TCM_CHECK_CONDITION_UNIT_ATTENTION:
|
||||
case TCM_CHECK_CONDITION_NOT_READY:
|
||||
|
|
@ -2967,6 +2968,15 @@ int transport_send_check_condition_and_sense(
|
|||
/* WRITE PROTECTED */
|
||||
buffer[offset+SPC_ASC_KEY_OFFSET] = 0x27;
|
||||
break;
|
||||
case TCM_ADDRESS_OUT_OF_RANGE:
|
||||
/* CURRENT ERROR */
|
||||
buffer[offset] = 0x70;
|
||||
buffer[offset+SPC_ADD_SENSE_LEN_OFFSET] = 10;
|
||||
/* ILLEGAL REQUEST */
|
||||
buffer[offset+SPC_SENSE_KEY_OFFSET] = ILLEGAL_REQUEST;
|
||||
/* LOGICAL BLOCK ADDRESS OUT OF RANGE */
|
||||
buffer[offset+SPC_ASC_KEY_OFFSET] = 0x21;
|
||||
break;
|
||||
case TCM_CHECK_CONDITION_UNIT_ATTENTION:
|
||||
/* CURRENT ERROR */
|
||||
buffer[offset] = 0x70;
|
||||
|
|
|
|||
Loading…
Reference in a new issue