From owner-freebsd-geom@FreeBSD.ORG Thu Jul 8 18:19:11 2004 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 543BC16A4CE for ; Thu, 8 Jul 2004 18:19:11 +0000 (GMT) Received: from darkness.comp.waw.pl (darkness.comp.waw.pl [195.117.238.236]) by mx1.FreeBSD.org (Postfix) with ESMTP id 005EE43D1D for ; Thu, 8 Jul 2004 18:19:11 +0000 (GMT) (envelope-from pjd@darkness.comp.waw.pl) Received: by darkness.comp.waw.pl (Postfix, from userid 1009) id 63F42ACAE3; Thu, 8 Jul 2004 20:19:09 +0200 (CEST) Date: Thu, 8 Jul 2004 20:19:09 +0200 From: Pawel Jakub Dawidek To: Poul-Henning Kamp Message-ID: <20040708181909.GT12007@darkness.comp.waw.pl> References: <20040707012904.GP12007@darkness.comp.waw.pl> <3838.1089306943@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="s1V7GiNVmT/EiLBY" Content-Disposition: inline In-Reply-To: <3838.1089306943@critter.freebsd.dk> User-Agent: Mutt/1.4.2i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 5.2.1-RC2 i386 cc: geom@freebsd.org Subject: Re: Current GEOM problems. X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2004 18:19:11 -0000 --s1V7GiNVmT/EiLBY Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 08, 2004 at 07:15:43PM +0200, Poul-Henning Kamp wrote: +> >2. Every class which use geom_slice cannot be unload when it has geoms +> > (actually providers), because g_slice_destroy_geom() calls +> > g_slice_spoiled() and g_slice_spoiled() calls g_wither_geom(). +> > If there are providers, geom will not be imediately destroyed, +> > but orphan event will be send, so next time when g_slice_destroy_geo= m() +> > will be called for the same geom it will panic, because gp->softc is +> > NULL. +>=20 +>=20 +> can you try this untested patch ? Nope, it doesn't work. I'll try to explain the problem more precise. When g_wither_geom() is called from g_unload_class() via destroy_geom method AND provider exists on this geom we can choose: panic or deadlock, because: - g_unload_class() is called from the event queue in blocking mode. - g_wither_geom() calls g_orphan_provider(). - g_orphan_provider() sends event, but the event queue is blocked, so provider can't be destroyed, so geom can't be withered. - g_unload_class() tries to destroy this geom in loop, but it can't be definitely destroyed. The simplest solution which cames to my mind is to skip geoms that are marked as beeing withered in g_unload_class(). BTW. You reproduce this panic by doing: # glabel create foo # glabel unload --=20 Pawel Jakub Dawidek http://www.FreeBSD.org pjd@FreeBSD.org http://garage.freebsd.pl FreeBSD committer Am I Evil? Yes, I Am! --s1V7GiNVmT/EiLBY Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFA7ZAdForvXbEpPzQRAiT+AJ9y1vfC5vHxoT6XTQqFwmfYS6qevgCfYa6h QSIOvqz82AvoJ6kYcPKHXTc= =b//M -----END PGP SIGNATURE----- --s1V7GiNVmT/EiLBY--