diff options
author | phk <phk@FreeBSD.org> | 2003-12-23 11:37:05 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2003-12-23 11:37:05 +0000 |
commit | fe692735bff0c4124372fb220744c13ca13657f2 (patch) | |
tree | 0393a5abf49b502a83fb38a892cef04d29ed817a /sys/geom | |
parent | 11aa947d12dba84a3f94ddcff9380bb6d3b1de25 (diff) | |
download | FreeBSD-src-fe692735bff0c4124372fb220744c13ca13657f2.zip FreeBSD-src-fe692735bff0c4124372fb220744c13ca13657f2.tar.gz |
Prevent withering of the provider we're orphaning from happening until
we do it ourselves.
Nailed by: Simon Heath <heath@cng.fr>
Diffstat (limited to 'sys/geom')
-rw-r--r-- | sys/geom/geom_event.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/geom/geom_event.c b/sys/geom/geom_event.c index 3c0f19f..2afaad6 100644 --- a/sys/geom/geom_event.c +++ b/sys/geom/geom_event.c @@ -126,10 +126,14 @@ static void g_orphan_register(struct g_provider *pp) { struct g_consumer *cp, *cp2; + int wf; g_trace(G_T_TOPOLOGY, "g_orphan_register(%s)", pp->name); g_topology_assert(); + wf = pp->flags & G_PF_WITHER; + pp->flags &= ~G_PF_WITHER; + /* * Tell all consumers the bad news. * Don't be surprised if they self-destruct. @@ -143,8 +147,10 @@ g_orphan_register(struct g_provider *pp) cp->geom->orphan(cp); cp = cp2; } - if (LIST_EMPTY(&pp->consumers) && (pp->flags & G_PF_WITHER)) + if (LIST_EMPTY(&pp->consumers) && wf) g_destroy_provider(pp); + else + pp->flags |= wf; #ifdef notyet cp = LIST_FIRST(&pp->consumers); if (cp != NULL) |