[PATCH 1/2] scsi: target: core: Add sense reason for space allocation errors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



According to SBC-3 4.7.3.6 this sense reason shall be used in situations
where thin provisioned logical unit cannot satisfy the write request due
to the lack of free blocks.

Signed-off-by: Konstantin Shelekhin <k.shelekhin@xxxxxxxxx>
Reviewed-by: Dmitry Bogdanov <d.bogdanov@xxxxxxxxx>
---
 drivers/target/target_core_transport.c | 6 ++++++
 include/target/target_core_base.h      | 1 +
 2 files changed, 7 insertions(+)

diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index 86adff2a86ed..9b41d2d78e98 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -2072,6 +2072,7 @@ void transport_generic_request_failure(struct se_cmd *cmd,
 	case TCM_ALUA_TG_PT_UNAVAILABLE:
 	case TCM_ALUA_STATE_TRANSITION:
 	case TCM_ALUA_OFFLINE:
+	case TCM_SPACE_ALLOCATION_FAILED:
 		break;
 	case TCM_OUT_OF_RESOURCES:
 		cmd->scsi_status = SAM_STAT_TASK_SET_FULL;
@@ -3474,6 +3475,11 @@ static const struct sense_detail sense_detail_table[] = {
 		.asc = 0x04,
 		.ascq = ASCQ_04H_ALUA_OFFLINE,
 	},
+	[TCM_SPACE_ALLOCATION_FAILED] = {
+		.key = DATA_PROTECT,
+		.asc = 0x27,
+		.ascq = 0x07, /* SPACE ALLOCATION FAILED WRITE PROTECT */
+	},
 };
 
 /**
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
index 5f8e96f1516f..aac475a9184e 100644
--- a/include/target/target_core_base.h
+++ b/include/target/target_core_base.h
@@ -194,6 +194,7 @@ enum tcm_sense_reason_table {
 	TCM_ALUA_TG_PT_UNAVAILABLE		= R(0x21),
 	TCM_ALUA_STATE_TRANSITION		= R(0x22),
 	TCM_ALUA_OFFLINE			= R(0x23),
+	TCM_SPACE_ALLOCATION_FAILED		= R(0x24),
 #undef R
 };
 
-- 
2.40.1





[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux