Re: panic in devstat_remove_entry

From: Poul-Henning Kamp <phk_at_phk.freebsd.dk>
Date: Fri, 05 Dec 2003 22:29:30 +0100
In message <20031205185949.GA861_at_buffy.brucec.backnet>, Bruce Cran writes:
>
>--r5Pyd7+fXNt84Ff3
>Content-Type: text/plain; charset=us-ascii
>Content-Disposition: inline
>
>I've found a way to panic 5.2-BETA which I can trigger in two ways.

Can you try with this patch ?


Index: geom_event.c
===================================================================
RCS file: /home/ncvs/src/sys/geom/geom_event.c,v
retrieving revision 1.43
diff -u -r1.43 geom_event.c
--- geom_event.c	18 Nov 2003 07:54:12 -0000	1.43
+++ geom_event.c	5 Dec 2003 21:29:03 -0000
_at__at_ -106,8 +106,12 _at__at_
 	KASSERT(error != 0,
 	    ("g_orphan_provider(%p(%s), 0) error must be non-zero\n",
 	     pp, pp->name));
+	
 	pp->error = error;
 	mtx_lock(&g_eventlock);
+	KASSERT(!(pp->flags & G_PF_ORPHAN),
+	    ("g_orphan_provider(%p(%s)), already an orphan", pp, pp->name));
+	pp->flags |= G_PF_ORPHAN;
 	TAILQ_INSERT_TAIL(&g_doorstep, pp, orphan);
 	mtx_unlock(&g_eventlock);
 	wakeup(&g_wait_event);

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk_at_FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.
Received on Fri Dec 05 2003 - 12:29:40 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:32 UTC