svn commit: r278237 - head/sys/dev/iscsi
Edward Tomasz Napierala
trasz at FreeBSD.org
Thu Feb 5 07:46:35 UTC 2015
Author: trasz
Date: Thu Feb 5 07:46:34 2015
New Revision: 278237
URL: https://svnweb.freebsd.org/changeset/base/278237
Log:
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
Modified:
head/sys/dev/iscsi/iscsi.c
Modified: head/sys/dev/iscsi/iscsi.c
==============================================================================
--- head/sys/dev/iscsi/iscsi.c Thu Feb 5 07:32:24 2015 (r278236)
+++ head/sys/dev/iscsi/iscsi.c Thu Feb 5 07:46:34 2015 (r278237)
@@ -421,6 +421,7 @@ iscsi_maintenance_thread_terminate(struc
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(struc
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_ses
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) {
More information about the svn-src-head
mailing list