scsi: target: add emulate_pr backstore attr to toggle PR support
authorDavid Disseldorp <ddiss@suse.de>
Wed, 7 Nov 2018 13:11:07 +0000 (14:11 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 22 Nov 2018 03:10:36 +0000 (22:10 -0500)
commitb49d6f7885306ee636d5c1af52170f3069ccf5f7
tree9422920bbe4153c54af39da2e5a0c34c2413677c
parent8d0bb86e2cf6c96d88c3de56a2a29329872c454d
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>
drivers/target/target_core_configfs.c
drivers/target/target_core_device.c
drivers/target/target_core_pr.c
drivers/target/target_core_spc.c
include/target/target_core_base.h