Author: markj
Date: Mon Mar 27 16:25:58 2017
New Revision: 316032
URL: https://svnweb.freebsd.org/changeset/base/316032

Log:
  Refine r301173 a bit.
  
  - Don't execute any of g_mirror_shutdown_post_sync() when panicking. We
    cannot safely idle the mirror or stop synchronization in that state, and
    the current attempts to do so complicate debugging of gmirror itself.
  - Check for a non-NULL panicstr instead of using SCHEDULER_STOPPED(). The
    latter was added for use in the locking primitives.
  
  Reviewed by:  mav, pjd
  MFC after:    2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/sys/geom/mirror/g_mirror.c

Modified: head/sys/geom/mirror/g_mirror.c
==============================================================================
--- head/sys/geom/mirror/g_mirror.c     Mon Mar 27 16:18:19 2017        
(r316031)
+++ head/sys/geom/mirror/g_mirror.c     Mon Mar 27 16:25:58 2017        
(r316032)
@@ -3040,7 +3040,7 @@ g_mirror_destroy(struct g_mirror_softc *
        g_topology_assert_not();
        sx_assert(&sc->sc_lock, SX_XLOCKED);
 
-       if (sc->sc_provider_open != 0 || SCHEDULER_STOPPED()) {
+       if (sc->sc_provider_open != 0) {
                switch (how) {
                case G_MIRROR_DESTROY_SOFT:
                        G_MIRROR_DEBUG(1,
@@ -3374,6 +3374,9 @@ g_mirror_shutdown_post_sync(void *arg, i
        struct g_mirror_softc *sc;
        int error;
 
+       if (panicstr != NULL)
+               return;
+
        mp = arg;
        g_topology_lock();
        g_mirror_shutdown = 1;
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to