]> git.karo-electronics.de Git - karo-tx-linux.git/commit
iscsi-target: Fix early login failure statistics misses
authorNicholas Bellinger <nab@linux-iscsi.org>
Fri, 24 Feb 2017 05:26:31 +0000 (21:26 -0800)
committerNicholas Bellinger <nab@linux-iscsi.org>
Mon, 27 Feb 2017 00:18:22 +0000 (16:18 -0800)
commit17c61ad66f2e09a9014ab2d4e1f04c8294427db1
treedb471e1b5fbb18cf5062aa36ed085cb26d807b5f
parentbd4e2d2907fa23a11d46217064ecf80470ddae10
iscsi-target: Fix early login failure statistics misses

Due to the long standing checks in iscsit_snmp_get_tiqn()
that assume conn->sess->tpg dereference of tpg->tpg_tiqn
for iscsit_collect_login_stats() usage, some of the early
login failure cases like ISCSI_LOGIN_STATUS_TGT_FORBIDDEN
where not getting incremented, due to sess->tpg assignment
happening later in iscsi_login_zero_tsih_s2().

Instead, use the earlier conn->tpg assignment done by
iscsi_target_locate_portal() -> iscsit_get_tpg_from_np()
so the existing counters are incremented correctly for
the various early login failure cases.

Also, go ahead and drop the old rate limiting check in
iscsit_collect_login_stats(), so we get the true number
of failed login attempts in the existing statistics.

Reported-by: Ryan Stiles <ras@datera.io>
Cc: Ryan Stiles <ras@datera.io>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/iscsi/iscsi_target_util.c