Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1ecc7586 authored by Lee Duncan's avatar Lee Duncan Committed by Nicholas Bellinger
Browse files

target: Allow Write Exclusive non-reservation holders to READ



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: default avatarLee Duncan <lduncan@suse.com>
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent 7216dc07
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -526,6 +526,18 @@ static int core_scsi3_pr_seq_non_holder(
				" reservation\n", cdb[0],
				core_scsi3_pr_dump_type(pr_reg_type));

			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;
               }
	}