diff options
author | phk <phk@FreeBSD.org> | 2003-03-10 23:41:41 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2003-03-10 23:41:41 +0000 |
commit | 29e1315705c89238422661038791bcd98cf379f0 (patch) | |
tree | e18cee8a7e73c81b17257d4b1ef6cd547de4d89a /sys/geom | |
parent | 35dab36ffaa5a804d1bafb8cae3384794c17214b (diff) | |
download | FreeBSD-src-29e1315705c89238422661038791bcd98cf379f0.zip FreeBSD-src-29e1315705c89238422661038791bcd98cf379f0.tar.gz |
If we run out of consumers while orphaning them, and the provider's geom
is withering, destroy the provider when done.
This was exposed by the recent change to geom_dev's orphaning logic.
Diffstat (limited to 'sys/geom')
-rw-r--r-- | sys/geom/geom_event.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/geom/geom_event.c b/sys/geom/geom_event.c index 42f21fc..c8bb15d 100644 --- a/sys/geom/geom_event.c +++ b/sys/geom/geom_event.c @@ -118,6 +118,11 @@ g_orphan_register(struct g_provider *pp) cp->geom->orphan(cp); cp = cp2; } + cp = LIST_FIRST(&pp->consumers); + if (cp != NULL) + return; + if (pp->geom->flags & G_GEOM_WITHER) + g_destroy_provider(pp); } static void |