diff options
author | Nicholas Bellinger <nab@daterainc.com> | 2013-08-19 18:10:38 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2013-09-09 17:29:27 -0400 |
commit | 818b571ca053e19be336de1cc75c01dd5445e969 (patch) | |
tree | 20b1244ccd2aa71d46abfe015b368742ebaecab1 | |
parent | a6b0133c19af1ab268ed1f4414efa2782896a870 (diff) |
target: Add TCM_MISCOMPARE_VERIFY sense handling
This patch adds TCM_MISCOMPARE_VERIFY (ASC=0x1d, ASCQ=0x00) sense
handling to transport_send_check_condition_and_sense(), which is
required for a COMPARE_AND_WRITE comparision failure.
Cc: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Martin Petersen <martin.petersen@oracle.com>
Cc: Chris Mason <chris.mason@fusionio.com>
Cc: James Bottomley <JBottomley@Parallels.com>
Cc: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Nicholas Bellinger <nab@daterainc.com>
-rw-r--r-- | drivers/target/target_core_transport.c | 9 | ||||
-rw-r--r-- | include/target/target_core_base.h | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 53d1d756f7f5..3d3dc97b34d9 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c | |||
@@ -2791,6 +2791,15 @@ transport_send_check_condition_and_sense(struct se_cmd *cmd, | |||
2791 | buffer[SPC_ASC_KEY_OFFSET] = asc; | 2791 | buffer[SPC_ASC_KEY_OFFSET] = asc; |
2792 | buffer[SPC_ASCQ_KEY_OFFSET] = ascq; | 2792 | buffer[SPC_ASCQ_KEY_OFFSET] = ascq; |
2793 | break; | 2793 | break; |
2794 | case TCM_MISCOMPARE_VERIFY: | ||
2795 | /* CURRENT ERROR */ | ||
2796 | buffer[0] = 0x70; | ||
2797 | buffer[SPC_ADD_SENSE_LEN_OFFSET] = 10; | ||
2798 | buffer[SPC_SENSE_KEY_OFFSET] = MISCOMPARE; | ||
2799 | /* MISCOMPARE DURING VERIFY OPERATION */ | ||
2800 | buffer[SPC_ASC_KEY_OFFSET] = 0x1d; | ||
2801 | buffer[SPC_ASCQ_KEY_OFFSET] = 0x00; | ||
2802 | break; | ||
2794 | case TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE: | 2803 | case TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE: |
2795 | default: | 2804 | default: |
2796 | /* CURRENT ERROR */ | 2805 | /* CURRENT ERROR */ |
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h index 6892b3332ebb..3313b7d91ac8 100644 --- a/include/target/target_core_base.h +++ b/include/target/target_core_base.h | |||
@@ -197,6 +197,7 @@ enum tcm_sense_reason_table { | |||
197 | TCM_ADDRESS_OUT_OF_RANGE = R(0x11), | 197 | TCM_ADDRESS_OUT_OF_RANGE = R(0x11), |
198 | TCM_OUT_OF_RESOURCES = R(0x12), | 198 | TCM_OUT_OF_RESOURCES = R(0x12), |
199 | TCM_PARAMETER_LIST_LENGTH_ERROR = R(0x13), | 199 | TCM_PARAMETER_LIST_LENGTH_ERROR = R(0x13), |
200 | TCM_MISCOMPARE_VERIFY = R(0x14), | ||
200 | #undef R | 201 | #undef R |
201 | }; | 202 | }; |
202 | 203 | ||