From b49d6f7885306ee636d5c1af52170f3069ccf5f7 Mon Sep 17 00:00:00 2001 From: David Disseldorp Date: Wed, 7 Nov 2018 14:11:07 +0100 Subject: 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 Reviewed-by: Mike Christie Reviewed-by: Christoph Hellwig Signed-off-by: Martin K. Petersen --- include/target/target_core_base.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/target') 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; -- cgit v1.2.3