diff options
author | Pawel Jakub Dawidek <pjd@FreeBSD.org> | 2005-05-25 13:10:04 +0000 |
---|---|---|
committer | Pawel Jakub Dawidek <pjd@FreeBSD.org> | 2005-05-25 13:10:04 +0000 |
commit | 0f2bbe5ba46a63f164dde113148cad8e783c1a82 (patch) | |
tree | 38a3f1fe3fe8610dc44b2a5d32d63584f1cfa405 /sys/geom/mirror/g_mirror.c | |
parent | 6ff766dcdf3d2c0e81d979c8aa3996a2f3be6fe1 (diff) | |
download | src-0f2bbe5ba46a63f164dde113148cad8e783c1a82.tar.gz src-0f2bbe5ba46a63f164dde113148cad8e783c1a82.zip |
- Call root_mount_rel() when provider IS created, not earlier.
This should close the race observed by Daniel Eriksson.
- Remove redundant wakeup().
Notes
Notes:
svn path=/head/; revision=146616
Diffstat (limited to 'sys/geom/mirror/g_mirror.c')
-rw-r--r-- | sys/geom/mirror/g_mirror.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/sys/geom/mirror/g_mirror.c b/sys/geom/mirror/g_mirror.c index 76ebf5a7e44c..505ce95bc7af 100644 --- a/sys/geom/mirror/g_mirror.c +++ b/sys/geom/mirror/g_mirror.c @@ -1438,6 +1438,12 @@ static int g_mirror_try_destroy(struct g_mirror_softc *sc) { + if (sc->sc_rootmount != NULL) { + G_MIRROR_DEBUG(1, "root_mount_rel[%u] %p", __LINE__, + sc->sc_rootmount); + root_mount_rel(sc->sc_rootmount); + sc->sc_rootmount = NULL; + } g_topology_lock(); if (!g_mirror_can_destroy(sc)) { g_topology_unlock(); @@ -1891,20 +1897,17 @@ g_mirror_update_device(struct g_mirror_softc *sc, boolean_t force) * Disks went down in starting phase, so destroy * device. */ - G_MIRROR_DEBUG(1, "root_mount_rel[1] %p", sc->sc_rootmount); - root_mount_rel(sc->sc_rootmount); - sc->sc_rootmount = NULL; callout_drain(&sc->sc_callout); sc->sc_flags |= G_MIRROR_DEVICE_FLAG_DESTROY; + G_MIRROR_DEBUG(1, "root_mount_rel[%u] %p", __LINE__, + sc->sc_rootmount); + root_mount_rel(sc->sc_rootmount); + sc->sc_rootmount = NULL; return; } else { return; } - G_MIRROR_DEBUG(1, "root_mount_rel[2] %p", sc->sc_rootmount); - root_mount_rel(sc->sc_rootmount); - sc->sc_rootmount = NULL; - /* * Activate all disks with the biggest syncid. */ @@ -1923,6 +1926,10 @@ g_mirror_update_device(struct g_mirror_softc *sc, boolean_t force) if (ndisks == 0) { /* No valid disks found, destroy device. */ sc->sc_flags |= G_MIRROR_DEVICE_FLAG_DESTROY; + G_MIRROR_DEBUG(1, "root_mount_rel[%u] %p", + __LINE__, sc->sc_rootmount); + root_mount_rel(sc->sc_rootmount); + sc->sc_rootmount = NULL; return; } } else { @@ -2054,7 +2061,6 @@ g_mirror_update_device(struct g_mirror_softc *sc, boolean_t force) if (state == G_MIRROR_DISK_STATE_STALE) sc->sc_bump_id |= G_MIRROR_BUMP_SYNCID; } - wakeup(&g_mirror_class); break; } case G_MIRROR_DEVICE_STATE_RUNNING: @@ -2078,6 +2084,12 @@ g_mirror_update_device(struct g_mirror_softc *sc, boolean_t force) if (sc->sc_provider == NULL) g_mirror_launch_provider(sc); } + if (sc->sc_rootmount != NULL) { + G_MIRROR_DEBUG(1, "root_mount_rel[%u] %p", __LINE__, + sc->sc_rootmount); + root_mount_rel(sc->sc_rootmount); + sc->sc_rootmount = NULL; + } /* * Genid should be bumped immediately, so do it here. */ |