Don't call callout_drain() with iscsi mutex held; this fixes a warning

that was introduced recently.  While here, don't try to access is_terminating
without lock.

MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Edward Tomasz Napierala 2015-02-05 07:46:34 +00:00
parent 83f375616e
commit 674074da06
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=278237

View File

@ -421,6 +421,7 @@ iscsi_maintenance_thread_terminate(struct iscsi_session *is)
sx_xunlock(&sc->sc_lock);
icl_conn_close(is->is_conn);
callout_drain(&is->is_callout);
ISCSI_SESSION_LOCK(is);
@ -434,8 +435,6 @@ iscsi_maintenance_thread_terminate(struct iscsi_session *is)
cv_signal(&is->is_login_cv);
#endif
callout_drain(&is->is_callout);
iscsi_session_cleanup(is, true);
KASSERT(TAILQ_EMPTY(&is->is_outstanding),
@ -511,6 +510,7 @@ iscsi_session_reconnect(struct iscsi_session *is)
static void
iscsi_session_terminate(struct iscsi_session *is)
{
if (is->is_terminating)
return;
@ -532,12 +532,14 @@ iscsi_callout(void *context)
is = context;
if (is->is_terminating)
ISCSI_SESSION_LOCK(is);
if (is->is_terminating) {
ISCSI_SESSION_UNLOCK(is);
return;
}
callout_schedule(&is->is_callout, 1 * hz);
ISCSI_SESSION_LOCK(is);
is->is_timeout++;
if (is->is_waiting_for_iscsid) {