Author: markj
Date: Fri Dec  8 20:04:10 2017
New Revision: 326715
URL: https://svnweb.freebsd.org/changeset/base/326715

Log:
  MFC r325044:
  Fix a lock leak in g_mirror_destroy().

Modified:
  stable/11/sys/geom/mirror/g_mirror.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/geom/mirror/g_mirror.c
==============================================================================
--- stable/11/sys/geom/mirror/g_mirror.c        Fri Dec  8 19:57:26 2017        
(r326714)
+++ stable/11/sys/geom/mirror/g_mirror.c        Fri Dec  8 20:04:10 2017        
(r326715)
@@ -3088,8 +3088,10 @@ g_mirror_destroy(struct g_mirror_softc *sc, int how)
                }
        }
 
-       if ((sc->sc_flags & G_MIRROR_DEVICE_FLAG_DESTROY) != 0)
+       if ((sc->sc_flags & G_MIRROR_DEVICE_FLAG_DESTROY) != 0) {
+               sx_xunlock(&sc->sc_lock);
                return (0);
+       }
        sc->sc_flags |= G_MIRROR_DEVICE_FLAG_DESTROY;
        sc->sc_flags |= G_MIRROR_DEVICE_FLAG_DRAIN;
        G_MIRROR_DEBUG(4, "%s: Waking up %p.", __func__, sc);
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to