geom(4): make g_newprovider_event() return if G_P_WITHER is set

This fixes a failed assertion in scenario where the provider
disappears, disk_gone() gets called, and at the exact same
time something else closes the device node triggering a retaste.

Reviewed By:	mav
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D27330
This commit is contained in:
Edward Tomasz Napierala 2020-12-29 14:29:54 +00:00
parent 3e404b8c53
commit 123019739c

View File

@ -575,8 +575,8 @@ g_new_provider_event(void *arg, int flag)
return;
pp = arg;
G_VALID_PROVIDER(pp);
KASSERT(!(pp->flags & G_PF_WITHER),
("g_new_provider_event but withered"));
if ((pp->flags & G_PF_WITHER) != 0)
return;
LIST_FOREACH_SAFE(cp, &pp->consumers, consumers, next_cp) {
if ((cp->flags & G_CF_ORPHAN) == 0 &&
cp->geom->attrchanged != NULL)