aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernhard Kohl <Riedel-und-Kohl@t-online.de>2012-05-13 23:39:37 +0200
committerNicholas Bellinger <nab@linux-iscsi.org>2012-05-14 14:52:56 -0700
commita574c39b560d6cbb8524f4fd47a5c2976ad77b77 (patch)
tree04b4374ea7a4486b0911b5a9eeb4314603fb921a
parentad8f8457c53d35528f9e81ed56ea81be4d0f6b24 (diff)
downloadlio-core-a574c39b560d6cbb8524f4fd47a5c2976ad77b77.tar.gz
target: Fix SPC-2 RELEASE bug for multi-session iSCSI client setups
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> Cc: <stable@vger.kernel.org> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
-rw-r--r--drivers/target/target_core_pr.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/target/target_core_pr.c b/drivers/target/target_core_pr.c
index eb48b156ded063..5fd4dd3d511389 100644
--- a/drivers/target/target_core_pr.c
+++ b/drivers/target/target_core_pr.c
@@ -214,6 +214,9 @@ int target_scsi2_reservation_release(struct se_cmd *cmd)
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) {