aboutsummaryrefslogtreecommitdiff
path: root/sys/geom/mirror/g_mirror.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/geom/mirror/g_mirror.c')
-rw-r--r--sys/geom/mirror/g_mirror.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/geom/mirror/g_mirror.c b/sys/geom/mirror/g_mirror.c
index d9b7e4cdb445..7f8f670d7461 100644
--- a/sys/geom/mirror/g_mirror.c
+++ b/sys/geom/mirror/g_mirror.c
@@ -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);