@@ -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);
+ }
}
}
}
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@redhat.com> --- drivers/target/target_core_transport.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)