From owner-freebsd-current@FreeBSD.ORG Tue Dec 23 04:27:03 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0E8D116A4CE for ; Tue, 23 Dec 2003 04:27:03 -0800 (PST) Received: from madiran.cng.fr (madiran.cng.fr [193.50.0.73]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4DDAC43D1D for ; Tue, 23 Dec 2003 04:27:01 -0800 (PST) (envelope-from heath@madiran.cng.fr) Received: (from heath@localhost)hBNCQxm20180; Tue, 23 Dec 2003 13:26:59 +0100 (MET) Date: Tue, 23 Dec 2003 13:26:59 +0100 From: Simon Heath To: Poul-Henning Kamp Message-ID: <20031223122659.GC14443@madiran.cng.fr> References: <20031223105208.GA8531@madiran.cng.fr> <43106.1072177560@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <43106.1072177560@critter.freebsd.dk> User-Agent: Mutt/1.3.27i cc: freebsd-current@freebsd.org Subject: Re: cd taste crash followup X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Dec 2003 12:27:03 -0000 On Tue, Dec 23, 2003 at 12:06:00PM +0100, Poul-Henning Kamp wrote: > In message <20031223105208.GA8531@madiran.cng.fr>, Simon Heath writes: > > >The calls come from g_orphan_register which calls g_dev_orphan() on each > >element from pp->consumers, which in turn calls g_detach() which calls > >g_destroy_provider(). g_orphan_register() then calls g_destroy_provider() > >directly with pp (because G_PF_WITHER is set), but pp has already been > >passed to g_destroy_provider() in the previous loop, so we end up with the > >attempt to remove the devstat twice. As to why pp appears as a provider in > >pp->consumers I have no idea, but I hope this makes some sense to people who > >understand GEOM. > > Sigh, I know the per provider wither flag sounded too easy... > > Can you try this patch ? > > Index: geom_event.c > =================================================================== > RCS file: /home/ncvs/src/sys/geom/geom_event.c,v > retrieving revision 1.44 > diff -u -r1.44 geom_event.c > --- geom_event.c 7 Dec 2003 10:04:43 -0000 1.44 > +++ geom_event.c 23 Dec 2003 11:04:58 -0000 > @@ -126,10 +126,14 @@ > 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 @@ > 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) > A small addition - I was also having problems with ripping audio CDs, I would get a panic from a page fault regularly on insertion of the 2nd CD. This was reported by others on the list last week. This patch solves both problems for me. Simon