It seemed like TCM_OUT_OF_RESOURCES was not supposed to be a hard failure like TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE. This patch translates TCM_OUT_OF_RESOURCES to SAM_STAT_TASK_SET_FULL so it can be retried by the initiator. Signed-off-by: Mike Christie <mchristi@xxxxxxxxxx> --- drivers/target/target_core_transport.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index faad7b4..79c9cbe 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -1692,8 +1692,8 @@ void transport_generic_request_failure(struct se_cmd *cmd, case TCM_UNSUPPORTED_SEGMENT_DESC_TYPE_CODE: break; case TCM_OUT_OF_RESOURCES: - sense_reason = TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; - break; + scsi_status = SAM_STAT_TASK_SET_FULL; + goto queue_completion; case TCM_RESERVATION_CONFLICT: /* * No SENSE Data payload for this case, set SCSI Status @@ -2114,7 +2114,12 @@ static void target_complete_cmd_work(struct work_struct *work) return; } else if (rc && good) { - transport_setup_sense(cmd, rc); + if (rc == TCM_OUT_OF_RESOURCES) { + cmd->scsi_status = + SAM_STAT_TASK_SET_FULL; + } else { + transport_setup_sense(cmd, rc); + } } } } -- 1.8.3.1 -- To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html