]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.10.34/iscsi-target-fix-iscsit_get_tpg_from_np-tpg_state-bug.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.10.34 / iscsi-target-fix-iscsit_get_tpg_from_np-tpg_state-bug.patch
CommitLineData
99663375
GKH
1From a2a99cea5ec7c1e47825559f0e75a4efbcf8aee3 Mon Sep 17 00:00:00 2001
2From: Nicholas Bellinger <nab@linux-iscsi.org>
3Date: Wed, 26 Feb 2014 03:09:41 -0800
4Subject: iscsi-target: Fix iscsit_get_tpg_from_np tpg_state bug
5
6From: Nicholas Bellinger <nab@linux-iscsi.org>
7
8commit a2a99cea5ec7c1e47825559f0e75a4efbcf8aee3 upstream.
9
10This patch fixes a bug in iscsit_get_tpg_from_np() where the
11tpg->tpg_state sanity check was looking for TPG_STATE_FREE,
12instead of != TPG_STATE_ACTIVE.
13
14The latter is expected during a normal TPG shutdown once the
15tpg_state goes into TPG_STATE_INACTIVE in order to reject any
16new incoming login attempts.
17
18Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
19Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20
21---
22 drivers/target/iscsi/iscsi_target_tpg.c | 2 +-
23 1 file changed, 1 insertion(+), 1 deletion(-)
24
25--- a/drivers/target/iscsi/iscsi_target_tpg.c
26+++ b/drivers/target/iscsi/iscsi_target_tpg.c
27@@ -138,7 +138,7 @@ struct iscsi_portal_group *iscsit_get_tp
28 list_for_each_entry(tpg, &tiqn->tiqn_tpg_list, tpg_list) {
29
30 spin_lock(&tpg->tpg_state_lock);
31- if (tpg->tpg_state == TPG_STATE_FREE) {
32+ if (tpg->tpg_state != TPG_STATE_ACTIVE) {
33 spin_unlock(&tpg->tpg_state_lock);
34 continue;
35 }