From owner-freebsd-current@FreeBSD.ORG Wed Jun 27 02:29:16 2012 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 71828106566C for ; Wed, 27 Jun 2012 02:29:16 +0000 (UTC) (envelope-from ken@kdm.org) Received: from nargothrond.kdm.org (nargothrond.kdm.org [70.56.43.81]) by mx1.freebsd.org (Postfix) with ESMTP id 363F98FC12 for ; Wed, 27 Jun 2012 02:29:16 +0000 (UTC) Received: from nargothrond.kdm.org (localhost [127.0.0.1]) by nargothrond.kdm.org (8.14.2/8.14.2) with ESMTP id q5R2TALo000183; Tue, 26 Jun 2012 20:29:10 -0600 (MDT) (envelope-from ken@nargothrond.kdm.org) Received: (from ken@localhost) by nargothrond.kdm.org (8.14.2/8.14.2/Submit) id q5R2TAND000182; Tue, 26 Jun 2012 20:29:10 -0600 (MDT) (envelope-from ken) Date: Tue, 26 Jun 2012 20:29:09 -0600 From: "Kenneth D. Merry" To: Michael Butler Message-ID: <20120627022909.GA153@nargothrond.kdm.org> References: <4FE9D958.4000901@protected-networks.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="OgqxwSJOaUobr8KG" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2i Cc: Benjamin Kaduk , current@freebsd.org Subject: Re: Removing an SDHC card causes a kernel panic on -current X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Wed, 27 Jun 2012 02:29:16 -0000 --OgqxwSJOaUobr8KG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Jun 26, 2012 at 19:41:07 -0400, Benjamin Kaduk wrote: > On Tue, 26 Jun 2012, Michael Butler wrote: > > >As follows, in "g_disk_providergone", a NULL pointer reference?: > > g_disk_providergone() is new in r237518 (by ken); ken cc'd. Can you try the attached patch to sys/geom/geom_disk.c? Also, do you have full dmesg information for when the panic happened? It looks like disk_destroy() has already been called in this case, and I suppose that's likely to happen for any of the users of the GEOM disk class that haven't been updated with the reference count changes I made in da(4). (i.e. all of the rest of them.) Let me know whether this works for you. Thanks, Ken -- Kenneth Merry ken@FreeBSD.ORG --OgqxwSJOaUobr8KG Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="geom_disk.c.20120626.1.txt" ==== //depot/users/kenm/FreeBSD-test2/sys/geom/geom_disk.c#7 - /usr/home/kenm/perforce4/kenm/FreeBSD-test2/sys/geom/geom_disk.c ==== *** /tmp/tmp.75357.20 Tue Jun 26 20:25:44 2012 --- /usr/home/kenm/perforce4/kenm/FreeBSD-test2/sys/geom/geom_disk.c Tue Jun 26 20:25:29 2012 *************** *** 502,507 **** --- 502,515 ---- struct g_disk_softc *sc; sc = (struct g_disk_softc *)pp->geom->softc; + + /* + * If the softc is already NULL, then we've probably been through + * g_disk_destroy already; there is nothing for us to do anyway. + */ + if (sc == NULL) + return; + dp = sc->dp; if (dp->d_gone != NULL) --OgqxwSJOaUobr8KG--