summaryrefslogtreecommitdiff
path: root/drivers/target
diff options
context:
space:
mode:
authorBernhard Kohl <Riedel-und-Kohl@t-online.de>2012-05-13 23:39:37 +0200
committerBen Hutchings <ben@decadent.org.uk>2012-05-20 22:56:47 +0100
commit1601be1f76779ab23b7d04f86a231ede6bd90edc (patch)
treeeffe16fd6b492bbfe171d3ab81ff41bd06b545f1 /drivers/target
parentf5dd890ef7c905ac61c3d3be1569df06849f74a3 (diff)
target: Fix SPC-2 RELEASE bug for multi-session iSCSI client setups
commit edc318d9fea6854df752ec8c645b960b0d5a1d23 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>
Diffstat (limited to 'drivers/target')
-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 6cf6ff4b9b1b..b75bc9299b4f 100644
--- a/drivers/target/target_core_pr.c
+++ b/drivers/target/target_core_pr.c
@@ -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) {