Author: trasz
Date: Fri May 15 10:50:58 2015
New Revision: 282955
URL: https://svnweb.freebsd.org/changeset/base/282955

Log:
  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

Modified:
  stable/10/sys/dev/iscsi/iscsi.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/iscsi/iscsi.c
==============================================================================
--- stable/10/sys/dev/iscsi/iscsi.c     Fri May 15 10:47:25 2015        
(r282954)
+++ stable/10/sys/dev/iscsi/iscsi.c     Fri May 15 10:50:58 2015        
(r282955)
@@ -425,6 +425,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);
 
@@ -438,8 +439,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),
@@ -515,6 +514,7 @@ iscsi_session_reconnect(struct iscsi_ses
 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) {
_______________________________________________
svn-src-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-unsubscr...@freebsd.org"

Reply via email to