diff options
author | Nicholas Bellinger <nab@linux-iscsi.org> | 2011-11-04 05:36:16 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2011-12-06 01:00:49 -0500 |
commit | 03e98c9eb916f3f0868c1dc344dde2a60287ff72 (patch) | |
tree | cfa47c1cec5b0a589b868c34310ee25f6a6a1939 /include/target/target_core_base.h | |
parent | 5611cc4572e889b62a7b4c72a413536bf6a9c416 (diff) |
target: Address legacy PYX_TRANSPORT_* return code breakage
This patch removes legacy usage of PYX_TRANSPORT_* return codes in a number
of locations and addresses cases where transport_generic_request_failure()
was returning the incorrect sense upon CHECK_CONDITION status after the
v3.1 converson to use errno return codes.
This includes the conversion of transport_generic_request_failure() to
process cmd->scsi_sense_reason and handle extra TCM_RESERVATION_CONFLICT
before calling transport_send_check_condition_and_sense() to queue up
response status. It also drops PYX_TRANSPORT_OUT_OF_MEMORY_RESOURCES legacy
usgae, and returns TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE w/ a response
for these cases.
transport_generic_allocate_tasks(), transport_generic_new_cmd(), backend
SCF_SCSI_DATA_SG_IO_CDB ->do_task(), and emulated ->execute_task() have
all been updated to set se_cmd->scsi_sense_reason and return errno codes
universally upon failure. This includes cmd->scsi_sense_reason assignment
in target_core_alua.c, target_core_pr.c and target_core_cdb.c emulation code.
Finally it updates fabric modules to remove the legacy usage, and for
TFO->new_cmd_map() callers forwards return values outside of fabric code.
iscsi-target has also been updated to remove a handful of special cases
related to the cleanup and signaling QUEUE_FULL handling w/ ft_write_pending()
(v2: Drop extra SCF_SCSI_CDB_EXCEPTION check during failure from
transport_generic_new_cmd, and re-add missing task->task_error_status
assignment in transport_complete_task)
Cc: Christoph Hellwig <hch@lst.de>
Cc: stable@kernel.org
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'include/target/target_core_base.h')
-rw-r--r-- | include/target/target_core_base.h | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h index 7f5fed3c89e1..4d0cb6b8c478 100644 --- a/include/target/target_core_base.h +++ b/include/target/target_core_base.h | |||
@@ -103,7 +103,6 @@ enum se_cmd_flags_table { | |||
103 | SCF_SCSI_NON_DATA_CDB = 0x00000040, | 103 | SCF_SCSI_NON_DATA_CDB = 0x00000040, |
104 | SCF_SCSI_CDB_EXCEPTION = 0x00000080, | 104 | SCF_SCSI_CDB_EXCEPTION = 0x00000080, |
105 | SCF_SCSI_RESERVATION_CONFLICT = 0x00000100, | 105 | SCF_SCSI_RESERVATION_CONFLICT = 0x00000100, |
106 | SCF_SE_CMD_FAILED = 0x00000400, | ||
107 | SCF_SE_LUN_CMD = 0x00000800, | 106 | SCF_SE_LUN_CMD = 0x00000800, |
108 | SCF_SE_ALLOW_EOO = 0x00001000, | 107 | SCF_SE_ALLOW_EOO = 0x00001000, |
109 | SCF_SENT_CHECK_CONDITION = 0x00004000, | 108 | SCF_SENT_CHECK_CONDITION = 0x00004000, |
@@ -154,6 +153,7 @@ enum tcm_sense_reason_table { | |||
154 | TCM_CHECK_CONDITION_ABORT_CMD = 0x0d, | 153 | TCM_CHECK_CONDITION_ABORT_CMD = 0x0d, |
155 | TCM_CHECK_CONDITION_UNIT_ATTENTION = 0x0e, | 154 | TCM_CHECK_CONDITION_UNIT_ATTENTION = 0x0e, |
156 | TCM_CHECK_CONDITION_NOT_READY = 0x0f, | 155 | TCM_CHECK_CONDITION_NOT_READY = 0x0f, |
156 | TCM_RESERVATION_CONFLICT = 0x10, | ||
157 | }; | 157 | }; |
158 | 158 | ||
159 | struct se_obj { | 159 | struct se_obj { |
@@ -422,8 +422,6 @@ struct se_cmd { | |||
422 | int sam_task_attr; | 422 | int sam_task_attr; |
423 | /* Transport protocol dependent state, see transport_state_table */ | 423 | /* Transport protocol dependent state, see transport_state_table */ |
424 | enum transport_state_table t_state; | 424 | enum transport_state_table t_state; |
425 | /* Transport specific error status */ | ||
426 | int transport_error_status; | ||
427 | /* Used to signal cmd->se_tfo->check_release_cmd() usage per cmd */ | 425 | /* Used to signal cmd->se_tfo->check_release_cmd() usage per cmd */ |
428 | int check_release:1; | 426 | int check_release:1; |
429 | int cmd_wait_set:1; | 427 | int cmd_wait_set:1; |