From 44901a0a11508242d27f08bcf46619d61eae36fa Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Thu, 17 Dec 2015 07:07:01 +0000 Subject: [PATCH] scst: Fix write-protected response From SBC-4: "If present, any write protection shall cause otherwise valid logical block access commands that request alteration of the medium to be terminated by the device server with CHECK CONDITION status with the sense key set to DATA PROTECT and the appropriate additional sense code for the condition." Hence set the additional sense code in responses to SCSI commands sent to read-only LUNs. Signed-off-by: Bart Van Assche git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6743 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/scst_const.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scst/include/scst_const.h b/scst/include/scst_const.h index caa54728c..a1e93f602 100644 --- a/scst/include/scst_const.h +++ b/scst/include/scst_const.h @@ -341,7 +341,7 @@ static inline int scst_sense_response_code(const uint8_t *sense) #define scst_sense_reported_luns_data_changed UNIT_ATTENTION, 0x3F, 0xE /* DATA_PROTECT is 7 */ -#define scst_sense_data_protect DATA_PROTECT, 0x00, 0 +#define scst_sense_data_protect DATA_PROTECT, 0x27, 0 /* ABORTED_COMMAND is 0xb */ #define scst_sense_aborted_command ABORTED_COMMAND, 0x00, 0