diff options
| -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 3c0f19f70fbb..2afaad6277f7 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) |
