Skip to contentSkip to conversation

target: add SAM_STAT_BUSY sense reason

PATCH In review Mike Christie 1 participant 1 message Dec 19, 2017 SCSI target

lore
Share & tools
lore
#0 lore raw

PATCH 2/5 target: add SAM_STAT_BUSY sense reason

Add SAM_STAT_BUSY sense_reason. The next patch will have target_core_user return this value while it is temporarily blocked and restarting.

---
 drivers/target/target_core_transport.c | 3 +++
 include/target/target_core_base.h      | 1 +
 2 files changed, 4 insertions(+)
drivers/target/target_core_transport.c +3 -0
index 58caacd..74b646f 100644
@@ -1774,6 +1774,9 @@ void transport_generic_request_failure(struct se_cmd *cmd,
 	case TCM_OUT_OF_RESOURCES:
 		cmd->scsi_status = SAM_STAT_TASK_SET_FULL;
 		goto queue_status;
+	case TCM_LUN_BUSY:
+		cmd->scsi_status = SAM_STAT_BUSY;
+		goto queue_status;
 	case TCM_RESERVATION_CONFLICT:
 		/*
 		 * No SENSE Data payload for this case, set SCSI Status
include/target/target_core_base.h +1 -0
index 2c8d811..00482f9 100644
@@ -183,6 +183,7 @@ enum tcm_sense_reason_table {
 	TCM_TOO_MANY_SEGMENT_DESCS		= R(0x1b),
 	TCM_UNSUPPORTED_SEGMENT_DESC_TYPE_CODE	= R(0x1c),
 	TCM_INSUFFICIENT_REGISTRATION_RESOURCES	= R(0x1d),
+	TCM_LUN_BUSY				= R(0x1e),
 #undef R
 };
 
Signature · 1 line
1.8.3.1