git: 123019739c90 - main - geom(4): make g_newprovider_event() return if G_P_WITHER is set

Edward Tomasz Napierala trasz at FreeBSD.org
Tue Dec 29 14:36:17 UTC 2020


The branch main has been updated by trasz:

URL: https://cgit.FreeBSD.org/src/commit/?id=123019739c905a0d3b3c8b47ab62817f5938b684

commit 123019739c905a0d3b3c8b47ab62817f5938b684
Author:     Edward Tomasz Napierala <trasz at FreeBSD.org>
AuthorDate: 2020-12-29 14:29:54 +0000
Commit:     Edward Tomasz Napierala <trasz at FreeBSD.org>
CommitDate: 2020-12-29 14:29:59 +0000

    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
---
 sys/geom/geom_subr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/geom/geom_subr.c b/sys/geom/geom_subr.c
index c46eebf9e329..2f7ea7754f7b 100644
--- a/sys/geom/geom_subr.c
+++ b/sys/geom/geom_subr.c
@@ -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)


More information about the dev-commits-src-all mailing list