diff options
author | Nicholas Bellinger <nab@linux-iscsi.org> | 2014-02-26 12:09:41 +0100 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2014-03-05 02:54:09 +0100 |
commit | a2a99cea5ec7c1e47825559f0e75a4efbcf8aee3 (patch) | |
tree | 7fe227c3f0302dc31ee18592224c52ae8da649c9 /drivers/target/iscsi/iscsi_target_tpg.c | |
parent | vhost/scsi: Check LUN structure byte 0 is set to 1, per spec (diff) | |
download | linux-a2a99cea5ec7c1e47825559f0e75a4efbcf8aee3.tar.xz linux-a2a99cea5ec7c1e47825559f0e75a4efbcf8aee3.zip |
iscsi-target: Fix iscsit_get_tpg_from_np tpg_state bug
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.
Cc: <stable@vger.kernel.org> #3.10+
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/iscsi/iscsi_target_tpg.c')
-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 39761837608d..44a5471de00f 100644 --- a/drivers/target/iscsi/iscsi_target_tpg.c +++ b/drivers/target/iscsi/iscsi_target_tpg.c @@ -137,7 +137,7 @@ struct iscsi_portal_group *iscsit_get_tpg_from_np( list_for_each_entry(tpg, &tiqn->tiqn_tpg_list, tpg_list) { spin_lock(&tpg->tpg_state_lock); - if (tpg->tpg_state == TPG_STATE_FREE) { + if (tpg->tpg_state != TPG_STATE_ACTIVE) { spin_unlock(&tpg->tpg_state_lock); continue; } |