]>
Commit | Line | Data |
---|---|---|
99663375 GKH |
1 | From a2a99cea5ec7c1e47825559f0e75a4efbcf8aee3 Mon Sep 17 00:00:00 2001 |
2 | From: Nicholas Bellinger <nab@linux-iscsi.org> | |
3 | Date: Wed, 26 Feb 2014 03:09:41 -0800 | |
4 | Subject: iscsi-target: Fix iscsit_get_tpg_from_np tpg_state bug | |
5 | ||
6 | From: Nicholas Bellinger <nab@linux-iscsi.org> | |
7 | ||
8 | commit a2a99cea5ec7c1e47825559f0e75a4efbcf8aee3 upstream. | |
9 | ||
10 | This patch fixes a bug in iscsit_get_tpg_from_np() where the | |
11 | tpg->tpg_state sanity check was looking for TPG_STATE_FREE, | |
12 | instead of != TPG_STATE_ACTIVE. | |
13 | ||
14 | The latter is expected during a normal TPG shutdown once the | |
15 | tpg_state goes into TPG_STATE_INACTIVE in order to reject any | |
16 | new incoming login attempts. | |
17 | ||
18 | Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org> | |
19 | Signed-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 | } |