From owner-freebsd-geom@FreeBSD.ORG Fri Mar 26 03:18:14 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 2774B16A4CE; Fri, 26 Mar 2004 03:18:14 -0800 (PST) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8495743D3F; Fri, 26 Mar 2004 03:18:13 -0800 (PST) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.11/8.12.11) with ESMTP id i2QBICI7001622; Fri, 26 Mar 2004 12:18:12 +0100 (CET) (envelope-from phk@phk.freebsd.dk) To: Pawel Jakub Dawidek From: "Poul-Henning Kamp" In-Reply-To: Your message of "Fri, 26 Mar 2004 12:00:46 +0100." <20040326110046.GD8930@darkness.comp.waw.pl> Date: Fri, 26 Mar 2004 12:18:12 +0100 Message-ID: <1621.1080299892@critter.freebsd.dk> cc: geom@FreeBSD.org cc: Lukas Ertl Subject: Re: Problem with g_unload_class() 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: Fri, 26 Mar 2004 11:18:14 -0000 In message <20040326110046.GD8930@darkness.comp.waw.pl>, Pawel Jakub Dawidek wr ites: >+> silly: >+> "I couldn't unload and couldn't. A lot of stuff got modified >+> and the module is now only half functional. >+>=20 >+> I'd prefer we have it be the first two (controlled by an option) but >+> currently we're sort of stuck in the bottom one. > >My idea is to use LIST_FOREACH_SAFE() macro, like I did in my old patch: > > http://people.freebsd.org/~pjd/patches/geom_subr.c.11.patch > >And maybe we should add: > > if (!LIST_EMPTY(&mp->geom)) > error =3D EBUSY; But that is exactly the "silly" scenario I would like to avoid: Now you have removed some of the geom instances an you have nuked the taste and config function and then you give up and leave the class still loaded. We may need to move to a "can?/commit!" like two-phase protocol. (see geom_stripe for another place where this is used) -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@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.