summaryrefslogtreecommitdiffstats
path: root/include/target
diff options
context:
space:
mode:
authorDavid Disseldorp <ddiss@suse.de>2018-11-07 14:11:07 +0100
committerMartin K. Petersen <martin.petersen@oracle.com>2018-11-21 22:10:36 -0500
commitb49d6f7885306ee636d5c1af52170f3069ccf5f7 (patch)
tree9422920bbe4153c54af39da2e5a0c34c2413677c /include/target
parent8d0bb86e2cf6c96d88c3de56a2a29329872c454d (diff)
downloadlinux-b49d6f7885306ee636d5c1af52170f3069ccf5f7.tar.gz
linux-b49d6f7885306ee636d5c1af52170f3069ccf5f7.tar.bz2
linux-b49d6f7885306ee636d5c1af52170f3069ccf5f7.zip
scsi: target: add emulate_pr backstore attr to toggle PR support
The new emulate_pr backstore attribute allows for Persistent Reservation and SCSI2 RESERVE/RELEASE support to be completely disabled. This can be useful for scenarios such as: - Ensuring ATS (Compare & Write) usage on recent VMware ESXi initiators. - Allowing clustered (e.g. tcm-user) backends to block such requests, avoiding the multi-node reservation state propagation. When explicitly disabled, PR and RESERVE/RELEASE requests receive Invalid Command Operation Code response sense data. Signed-off-by: David Disseldorp <ddiss@suse.de> Reviewed-by: Mike Christie <mchristi@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'include/target')
-rw-r--r--include/target/target_core_base.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
index e3bdb0550a59..c15054116b86 100644
--- a/include/target/target_core_base.h
+++ b/include/target/target_core_base.h
@@ -87,6 +87,8 @@
#define DA_EMULATE_3PC 1
/* No Emulation for PSCSI by default */
#define DA_EMULATE_ALUA 0
+/* Emulate SCSI2 RESERVE/RELEASE and Persistent Reservations by default */
+#define DA_EMULATE_PR 1
/* Enforce SCSI Initiator Port TransportID with 'ISID' for PR */
#define DA_ENFORCE_PR_ISIDS 1
/* Force SPC-3 PR Activate Persistence across Target Power Loss */
@@ -664,6 +666,7 @@ struct se_dev_attrib {
int emulate_tpws;
int emulate_caw;
int emulate_3pc;
+ int emulate_pr;
int pi_prot_format;
enum target_prot_type pi_prot_type;
enum target_prot_type hw_pi_prot_type;