summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLee Duncan <lduncan@suse.com>2015-01-05 10:49:44 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-03-26 15:07:00 +0100
commit4f1d1adb44d160ba7c14353689b43ce1a107fba0 (patch)
treee39ae75eb9ed70188d3f4d7a898158c4ff7768c3
parentc3d6b5796b22abf78007bd6bb196d1f95a29ac19 (diff)
target: Allow Write Exclusive non-reservation holders to READ
commit 1ecc7586922662e3ca2f3f0c3f17fec8749fc621 upstream. For PGR reservation of type Write Exclusive Access, allow all non reservation holding I_T nexuses with active registrations to READ from the device. This addresses a bug where active registrations that attempted to READ would result in an reservation conflict. Signed-off-by: Lee Duncan <lduncan@suse.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/target/target_core_pr.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/target/target_core_pr.c b/drivers/target/target_core_pr.c
index 41a6bfaa22d8..70cb37516d40 100644
--- a/drivers/target/target_core_pr.c
+++ b/drivers/target/target_core_pr.c
@@ -528,6 +528,18 @@ static int core_scsi3_pr_seq_non_holder(
return 0;
}
+ } else if (we && registered_nexus) {
+ /*
+ * Reads are allowed for Write Exclusive locks
+ * from all registrants.
+ */
+ if (cmd->data_direction == DMA_FROM_DEVICE) {
+ pr_debug("Allowing READ CDB: 0x%02x for %s"
+ " reservation\n", cdb[0],
+ core_scsi3_pr_dump_type(pr_reg_type));
+
+ return 0;
+ }
}
pr_debug("%s Conflict for %sregistered nexus %s CDB: 0x%2x"
" for %s reservation\n", transport_dump_cmd_direction(cmd),