diff options
author | mav <mav@FreeBSD.org> | 2012-07-29 20:04:09 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2012-07-29 20:04:09 +0000 |
commit | 2e17d98c0de2c9c781c756ef727f968bab7b5a26 (patch) | |
tree | 71c0a3bd0f54aed0c3c6a4625f0031dcacbe6b13 /sys/geom | |
parent | dcd4c15b163e4cd614852d584071ed807d5f5bc9 (diff) | |
download | FreeBSD-src-2e17d98c0de2c9c781c756ef727f968bab7b5a26.zip FreeBSD-src-2e17d98c0de2c9c781c756ef727f968bab7b5a26.tar.gz |
Partially revert r238886 in part of GEOM_VFS spoiling.
This change triggered interesting foot shooting condition in GEOM when
RW access to root partition by fsck spoils VFS geom there, which has it
opened RO at the same time. Seems spoiling concept needs some rework.
Diffstat (limited to 'sys/geom')
-rw-r--r-- | sys/geom/geom_vfs.c | 31 |
1 files changed, 1 insertions, 30 deletions
diff --git a/sys/geom/geom_vfs.c b/sys/geom/geom_vfs.c index 86d0b55..ade1790 100644 --- a/sys/geom/geom_vfs.c +++ b/sys/geom/geom_vfs.c @@ -65,13 +65,11 @@ static struct buf_ops __g_vfs_bufops = { struct buf_ops *g_vfs_bufops = &__g_vfs_bufops; static g_orphan_t g_vfs_orphan; -static g_spoiled_t g_vfs_spoiled; static struct g_class g_vfs_class = { .name = "VFS", .version = G_VERSION, .orphan = g_vfs_orphan, - .spoiled = g_vfs_spoiled, }; DECLARE_GEOM_CLASS(g_vfs_class, g_vfs); @@ -217,35 +215,8 @@ g_vfs_orphan(struct g_consumer *cp) if (sc == NULL) return; mtx_lock(&sc->sc_mtx); - destroy = (sc->sc_active == 0 && sc->sc_orphaned == 0); - sc->sc_orphaned = 1; - mtx_unlock(&sc->sc_mtx); - if (destroy) - g_vfs_destroy(cp, 0); - - /* - * Do not destroy the geom. Filesystem will do that during unmount. - */ -} - -static void -g_vfs_spoiled(struct g_consumer *cp) -{ - struct g_geom *gp; - struct g_vfs_softc *sc; - int destroy; - - g_topology_assert(); - - gp = cp->geom; - g_trace(G_T_TOPOLOGY, "g_vfs_spoiled(%p(%s))", cp, gp->name); - cp->flags |= G_CF_ORPHAN; - sc = gp->softc; - if (sc == NULL) - return; - mtx_lock(&sc->sc_mtx); - destroy = (sc->sc_active == 0 && sc->sc_orphaned == 0); sc->sc_orphaned = 1; + destroy = (sc->sc_active == 0); mtx_unlock(&sc->sc_mtx); if (destroy) g_vfs_destroy(cp, 0); |