diff options
author | trasz <trasz@FreeBSD.org> | 2015-05-15 10:50:58 +0000 |
---|---|---|
committer | trasz <trasz@FreeBSD.org> | 2015-05-15 10:50:58 +0000 |
commit | b843dffbc95eac25eb15f4e79ddfc37dcba33f27 (patch) | |
tree | b1582bd3ecf00fcc3d89321d9b0c825bf84774f4 /sys | |
parent | c22dbda4c6571ca2cc6ccfedb9b46363377a9f62 (diff) | |
download | FreeBSD-src-b843dffbc95eac25eb15f4e79ddfc37dcba33f27.zip FreeBSD-src-b843dffbc95eac25eb15f4e79ddfc37dcba33f27.tar.gz |
MFC r278237:
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.
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/iscsi/iscsi.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/dev/iscsi/iscsi.c b/sys/dev/iscsi/iscsi.c index a385d1c..4386675 100644 --- a/sys/dev/iscsi/iscsi.c +++ b/sys/dev/iscsi/iscsi.c @@ -425,6 +425,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); @@ -438,8 +439,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), @@ -515,6 +514,7 @@ iscsi_session_reconnect(struct iscsi_session *is) static void iscsi_session_terminate(struct iscsi_session *is) { + if (is->is_terminating) return; @@ -536,12 +536,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) { |