Skip to content

Commit

Permalink
target: Allow Write Exclusive non-reservation holders to READ
Browse files Browse the repository at this point in the history
commit 1ecc758 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>
  • Loading branch information
Lee Duncan authored and Greg Kroah-Hartman committed Mar 26, 2015
1 parent 5e15fee commit 362684e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions drivers/target/target_core_pr.c
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,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),
Expand Down

0 comments on commit 362684e

Please sign in to comment.