Skip to content

Commit

Permalink
target: Fix SPC-2 RELEASE bug for multi-session iSCSI client setups
Browse files Browse the repository at this point in the history
commit edc318d upstream.

This patch addresses a bug in a special case for target core SPC-2 RELEASE
logic where the same physical client (eg: iSCSI InitiatorName) with
differing iSCSI session identifiers (ISID) is allowed to incorrectly release
the same client's SPC-2 reservation from the non reservation holding path.

Note this bug is specific to iscsi-target w/ SPC-2 reservations, and
with the default enforce_pr_isids=1 device attr setting in target-core
controls if a InitiatorName + different ISID reservations are handled
the same as a single iSCSI client entity.

Signed-off-by: Bernhard Kohl <bernhard.kohl@gmx.net>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
  • Loading branch information
Bernhard Kohl authored and bwhacks committed May 20, 2012
1 parent f5dd890 commit 1601be1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/target/target_core_pr.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ int target_scsi2_reservation_release(struct se_task *task)
if (dev->dev_reserved_node_acl != sess->se_node_acl)
goto out_unlock;

if (dev->dev_res_bin_isid != sess->sess_bin_isid)
goto out_unlock;

dev->dev_reserved_node_acl = NULL;
dev->dev_flags &= ~DF_SPC2_RESERVATIONS;
if (dev->dev_flags & DF_SPC2_RESERVATIONS_WITH_ISID) {
Expand Down

0 comments on commit 1601be1

Please sign in to comment.