diff options
author | Roland Dreier <roland@purestorage.com> | 2013-02-08 15:18:39 -0800 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2013-02-13 12:16:05 -0800 |
commit | bb992e72f9b751fceb04afeb7736b6a3e50effcf (patch) | |
tree | 432d59d06184a8909b4e43e0ae9fdb0dd4bdf1ed /include | |
parent | 33633676df0d16d0685f2fbc571143801bc16e3b (diff) | |
download | blackbird-op-linux-bb992e72f9b751fceb04afeb7736b6a3e50effcf.tar.gz blackbird-op-linux-bb992e72f9b751fceb04afeb7736b6a3e50effcf.zip |
target: Fix error checking for UNMAP commands
SBC-3 (revision 35) says:
The PARAMETER LIST LENGTH field specifies the length in bytes of the
UNMAP parameter list that is available to be transferred from the
Data-Out Buffer. If the parameter list length is greater than zero
and less than 0008h (i.e., eight), 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 set to
PARAMETER LIST LENGTH ERROR. A PARAMETER LIST LENGTH set to zero
specifies that no data shall be sent.
so our sense code for too-short descriptors was wrong, and we were
incorrectly failing commands that didn't transfer any descriptors.
While we're at it, also handle the UNMAP check:
If the ANCHOR bit is set to one, and the ANC_SUP bit in the Logical
Block Provisioning VPD page (see 6.6.4) is set to zero, 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 set to INVALID FIELD IN CDB.
(chris boot: Fix wrong cut+paste comment in transport_send_check_condition_and_sense)
Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/target/target_core_base.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h index df14dce59191..c4af592f7057 100644 --- a/include/target/target_core_base.h +++ b/include/target/target_core_base.h @@ -195,6 +195,7 @@ enum tcm_sense_reason_table { TCM_RESERVATION_CONFLICT = R(0x10), TCM_ADDRESS_OUT_OF_RANGE = R(0x11), TCM_OUT_OF_RESOURCES = R(0x12), + TCM_PARAMETER_LIST_LENGTH_ERROR = R(0x13), #undef R }; |