Skip to content

Commit a2a99ce

Browse files
author
Nicholas Bellinger
committed
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: <[email protected]> #3.10+ Signed-off-by: Nicholas Bellinger <[email protected]>
1 parent 7fe412d commit a2a99ce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/target/iscsi/iscsi_target_tpg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ struct iscsi_portal_group *iscsit_get_tpg_from_np(
137137
list_for_each_entry(tpg, &tiqn->tiqn_tpg_list, tpg_list) {
138138

139139
spin_lock(&tpg->tpg_state_lock);
140-
if (tpg->tpg_state == TPG_STATE_FREE) {
140+
if (tpg->tpg_state != TPG_STATE_ACTIVE) {
141141
spin_unlock(&tpg->tpg_state_lock);
142142
continue;
143143
}

0 commit comments

Comments
 (0)