mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-17 15:27:36 +00:00
Prevent withering of the provider we're orphaning from happening until
we do it ourselves. Nailed by: Simon Heath <heath@cng.fr>
This commit is contained in:
parent
a46f7e7c92
commit
8592d7a760
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=123761
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user