diff options
author | Nicholas Bellinger <nab@linux-iscsi.org> | 2014-02-26 06:09:41 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-03-24 00:38:17 -0400 |
commit | 42890f74fac83d16035cdd201187a4d3113a9996 (patch) | |
tree | b034c2625401e6b862ba83fcf319b5b843c15689 | |
parent | d4be842bb4b516bcc3a8e84dab18121b376a6eb7 (diff) |
iscsi-target: Fix iscsit_get_tpg_from_np tpg_state bug
commit a2a99cea5ec7c1e47825559f0e75a4efbcf8aee3 upstream.
This patch fixes a bug in iscsit_get_tpg_from_np() where the
tpg->tpg_state sanity check was looking for TPG_STATE_FREE,
instead of != TPG_STATE_ACTIVE.
The latter is expected during a normal TPG shutdown once the
tpg_state goes into TPG_STATE_INACTIVE in order to reject any
new incoming login attempts.
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/target/iscsi/iscsi_target_tpg.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/target/iscsi/iscsi_target_tpg.c b/drivers/target/iscsi/iscsi_target_tpg.c index 439260b7d87f..f31b4c5cdf3f 100644 --- a/drivers/target/iscsi/iscsi_target_tpg.c +++ b/drivers/target/iscsi/iscsi_target_tpg.c | |||
@@ -138,7 +138,7 @@ struct iscsi_portal_group *iscsit_get_tpg_from_np( | |||
138 | list_for_each_entry(tpg, &tiqn->tiqn_tpg_list, tpg_list) { | 138 | list_for_each_entry(tpg, &tiqn->tiqn_tpg_list, tpg_list) { |
139 | 139 | ||
140 | spin_lock(&tpg->tpg_state_lock); | 140 | spin_lock(&tpg->tpg_state_lock); |
141 | if (tpg->tpg_state == TPG_STATE_FREE) { | 141 | if (tpg->tpg_state != TPG_STATE_ACTIVE) { |
142 | spin_unlock(&tpg->tpg_state_lock); | 142 | spin_unlock(&tpg->tpg_state_lock); |
143 | continue; | 143 | continue; |
144 | } | 144 | } |