From owner-freebsd-geom@FreeBSD.ORG Fri Mar 26 02:55:17 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 C683016A4D1; Fri, 26 Mar 2004 02:55:17 -0800 (PST) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id ECC6143D3F; Fri, 26 Mar 2004 02:55:16 -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 i2QAtEuN001265; Fri, 26 Mar 2004 11:55:15 +0100 (CET) (envelope-from phk@phk.freebsd.dk) To: Lukas Ertl From: "Poul-Henning Kamp" In-Reply-To: Your message of "Mon, 22 Mar 2004 21:27:51 +0100." <20040322211631.S636@korben.in.tern> Date: Fri, 26 Mar 2004 11:55:14 +0100 Message-ID: <1264.1080298514@critter.freebsd.dk> cc: geom@FreeBSD.org 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 10:55:17 -0000 Hi, this just to say that I have not forgot you. The underlying problem is how we want unloading to work. There are two sensible an one bad way it could work: sensible 1: "I tried to unload, but couldn't, nothing has changed". sensible 2: "I forcefully unloaded, you probably lost some data" silly: "I couldn't unload and couldn't. A lot of stuff got modified and the module is now only half functional. 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. In message <20040322211631.S636@korben.in.tern>, Lukas Ertl writes: >Hi Poul, > >I'm having a problem with a change you committed to geom_subr.c in >rev.1.74, where you changed g_unload_class() from a LIST_FOREACH() to a >for(;;). > >One of the vinum classes I'm tinkering with uses the slice code as a base >class to slice up the underlying device. Now, with this particular >commit, I get the following on kldunload: > >*) when my class provides a destroy method itself, it hangs endlessly in > this 'for (;;)' loop (maybe it's because I load multiple classes in > one module?). >*) when relying on the destroy method of the slice class, I get a panic in > g_slice_spoiled(), apparently because it was passed a NULL pointer > which is dereferenced at "gp = cp->geom;". > >Unfortunately, I wasn't yet able to really debug this, since in the first >case it won't let me break out to the debugger, and in the second case I >can't get a usable coredump (see my mails to -current in the last few >days). > >Of course, I don't expect you to find a solution in your magic ball, but I >thought maybe you have some ideas about that. > >thanks, >le > >-- >Lukas Ertl http://mailbox.univie.ac.at/~le/ >le@FreeBSD.org http://people.freebsd.org/~le/ > -- 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. From owner-freebsd-geom@FreeBSD.ORG Fri Mar 26 03:00:50 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 65FFB16A4CE; Fri, 26 Mar 2004 03:00:50 -0800 (PST) Received: from darkness.comp.waw.pl (unknown [195.117.238.236]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8675F43D41; Fri, 26 Mar 2004 03:00:47 -0800 (PST) (envelope-from pjd@darkness.comp.waw.pl) Received: by darkness.comp.waw.pl (Postfix, from userid 1009) id 109DDACAF8; Fri, 26 Mar 2004 12:00:46 +0100 (CET) Date: Fri, 26 Mar 2004 12:00:46 +0100 From: Pawel Jakub Dawidek To: Poul-Henning Kamp Message-ID: <20040326110046.GD8930@darkness.comp.waw.pl> References: <20040322211631.S636@korben.in.tern> <1264.1080298514@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/ZPAxgSw4JMezHmq" Content-Disposition: inline In-Reply-To: <1264.1080298514@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 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:00:50 -0000 --/ZPAxgSw4JMezHmq Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Mar 26, 2004 at 11:55:14AM +0100, Poul-Henning Kamp wrote: +> Hi, this just to say that I have not forgot you. +>=20 +> The underlying problem is how we want unloading to work. There are two +> sensible an one bad way it could work: +>=20 +> sensible 1: +> "I tried to unload, but couldn't, nothing has changed". +>=20 +> sensible 2: +> "I forcefully unloaded, you probably lost some data" +>=20 +> 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; after this loop. With this change we don't leave objects from class that was unloaded and we'll not end up with an infinite loop. --=20 Pawel Jakub Dawidek http://www.FreeBSD.org pjd@FreeBSD.org http://garage.freebsd.pl FreeBSD committer Am I Evil? Yes, I Am! --/ZPAxgSw4JMezHmq Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAZA1eForvXbEpPzQRAvWDAKDQYXs0W3ZLsC3VcKJ4XTlw3Ni3LgCdG+aY hYNeS5MgJwFStyv5aMXBxgw= =IsKK -----END PGP SIGNATURE----- --/ZPAxgSw4JMezHmq-- 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. From owner-freebsd-geom@FreeBSD.ORG Fri Mar 26 03:24:57 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 4E19D16A4CE; Fri, 26 Mar 2004 03:24:57 -0800 (PST) Received: from mailbox.univie.ac.at (mailbox.univie.ac.at [131.130.1.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id A705843D48; Fri, 26 Mar 2004 03:24:56 -0800 (PST) (envelope-from le@FreeBSD.org) Received: from pcle2.cc.univie.ac.at (pcle2.cc.univie.ac.at [131.130.2.177]) i2QBHAUp853112; Fri, 26 Mar 2004 12:17:15 +0100 Date: Fri, 26 Mar 2004 12:17:10 +0100 (CET) From: Lukas Ertl To: Pawel Jakub Dawidek In-Reply-To: <20040326110046.GD8930@darkness.comp.waw.pl> Message-ID: <20040326121624.N56656@pcle2.cc.univie.ac.at> References: <20040322211631.S636@korben.in.tern> <1264.1080298514@critter.freebsd.dk> <20040326110046.GD8930@darkness.comp.waw.pl> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-DCC-ZID-Univie-Metrics: imap 4244; Body=0 Fuz1=0 Fuz2=0 cc: geom@FreeBSD.org cc: Poul-Henning Kamp 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:24:57 -0000 On Fri, 26 Mar 2004, Pawel Jakub Dawidek wrote: > 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 Yes, please. cheers, le -- Lukas Ertl http://mailbox.univie.ac.at/~le/ le@FreeBSD.org http://people.freebsd.org/~le/ From owner-freebsd-geom@FreeBSD.ORG Fri Mar 26 03:32:53 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 26C5116A4CF; Fri, 26 Mar 2004 03:32:53 -0800 (PST) Received: from darkness.comp.waw.pl (unknown [195.117.238.236]) by mx1.FreeBSD.org (Postfix) with ESMTP id C15DE43D41; Fri, 26 Mar 2004 03:32:52 -0800 (PST) (envelope-from pjd@darkness.comp.waw.pl) Received: by darkness.comp.waw.pl (Postfix, from userid 1009) id CAB65ACAF8; Fri, 26 Mar 2004 12:32:51 +0100 (CET) Date: Fri, 26 Mar 2004 12:32:51 +0100 From: Pawel Jakub Dawidek To: Poul-Henning Kamp Message-ID: <20040326113251.GE8930@darkness.comp.waw.pl> References: <20040326110046.GD8930@darkness.comp.waw.pl> <1621.1080299892@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="JViz224v3YRbOSfM" Content-Disposition: inline In-Reply-To: <1621.1080299892@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 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:32:53 -0000 --JViz224v3YRbOSfM Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Mar 26, 2004 at 12:18:12PM +0100, Poul-Henning Kamp wrote: +> >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 =3D3D EBUSY; +>=20 +> 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. Or we can just remove all this code and leave only this: /* * We allow unloading if we have no geoms, or a class * method we can use to get rid of them. */ if (!LIST_EMPTY(&mp->geom) && mp->destroy_geom =3D=3D NULL) { hh->error =3D EOPNOTSUPP; return; } +> We may need to move to a "can?/commit!" like two-phase protocol. +> (see geom_stripe for another place where this is used) My geom_stripe? Anyway this will be a big change. --=20 Pawel Jakub Dawidek http://www.FreeBSD.org pjd@FreeBSD.org http://garage.freebsd.pl FreeBSD committer Am I Evil? Yes, I Am! --JViz224v3YRbOSfM Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAZBTjForvXbEpPzQRAt3dAJ42uGB8rJoCtMlMZ3Wg1+2Dd/tY5ACfRemC 3he1mtBNDoDuLHst59BQaoI= =SYni -----END PGP SIGNATURE----- --JViz224v3YRbOSfM-- From owner-freebsd-geom@FreeBSD.ORG Fri Mar 26 03:34:10 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 923CB16A4CF; Fri, 26 Mar 2004 03:34:10 -0800 (PST) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id DD37243D1D; Fri, 26 Mar 2004 03:34:09 -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 i2QBY8EY001980; Fri, 26 Mar 2004 12:34:09 +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:32:51 +0100." <20040326113251.GE8930@darkness.comp.waw.pl> Date: Fri, 26 Mar 2004 12:34:08 +0100 Message-ID: <1979.1080300848@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:34:10 -0000 In message <20040326113251.GE8930@darkness.comp.waw.pl>, Pawel Jakub Dawidek wr ites: > >+> We may need to move to a "can?/commit!" like two-phase protocol. >+> (see geom_stripe for another place where this is used) > >My geom_stripe? Sorry, I meant geom_slice. >Anyway this will be a big change. No it isn't. -- 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. From owner-freebsd-geom@FreeBSD.ORG Fri Mar 26 03:35:28 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 8555F16A4CE; Fri, 26 Mar 2004 03:35:28 -0800 (PST) Received: from darkness.comp.waw.pl (unknown [195.117.238.236]) by mx1.FreeBSD.org (Postfix) with ESMTP id 31AE543D49; Fri, 26 Mar 2004 03:35:28 -0800 (PST) (envelope-from pjd@darkness.comp.waw.pl) Received: by darkness.comp.waw.pl (Postfix, from userid 1009) id 69E17ACADB; Fri, 26 Mar 2004 12:35:27 +0100 (CET) Date: Fri, 26 Mar 2004 12:35:27 +0100 From: Pawel Jakub Dawidek To: Poul-Henning Kamp Message-ID: <20040326113527.GF8930@darkness.comp.waw.pl> References: <20040326110046.GD8930@darkness.comp.waw.pl> <1621.1080299892@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="zMXjX+MeVRpM4hLZ" Content-Disposition: inline In-Reply-To: <1621.1080299892@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 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:35:28 -0000 --zMXjX+MeVRpM4hLZ Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Mar 26, 2004 at 12:18:12PM +0100, Poul-Henning Kamp wrote: +> 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. BTW. Why can't we nuke config and taste here: if (error =3D=3D 0) { mp->taste =3D NULL; mp->config =3D NULL; if (mp->fini !=3D NULL) mp->fini(mp); LIST_REMOVE(mp, class); } Those events are called from the event queue, aren't they? So this should be safe. --=20 Pawel Jakub Dawidek http://www.FreeBSD.org pjd@FreeBSD.org http://garage.freebsd.pl FreeBSD committer Am I Evil? Yes, I Am! --zMXjX+MeVRpM4hLZ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAZBV/ForvXbEpPzQRApwmAJ9OGTANOGqa1kNIy+IuvuE/50AmSACg3NTM bhsWHc74p1aHUPgOCLqou3E= =n0NP -----END PGP SIGNATURE----- --zMXjX+MeVRpM4hLZ-- From owner-freebsd-geom@FreeBSD.ORG Fri Mar 26 03:40:52 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 5191116A4CE; Fri, 26 Mar 2004 03:40:52 -0800 (PST) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9919943D2F; Fri, 26 Mar 2004 03:40:51 -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 i2QBeoDa002094; Fri, 26 Mar 2004 12:40:50 +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:35:27 +0100." <20040326113527.GF8930@darkness.comp.waw.pl> Date: Fri, 26 Mar 2004 12:40:50 +0100 Message-ID: <2093.1080301250@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:40:52 -0000 In message <20040326113527.GF8930@darkness.comp.waw.pl>, Pawel Jakub Dawidek wr ites: >BTW. Why can't we nuke config and taste here: > > if (error =3D=3D 0) { > mp->taste =3D NULL; > mp->config =3D NULL; > if (mp->fini !=3D NULL) > mp->fini(mp); > LIST_REMOVE(mp, class); > } > >Those events are called from the event queue, aren't they? >So this should be safe. That would force config to be only called from the event queue, that is a hefty price to pay. But a two pass is still necessary so we don't destroy half of the geoms and not the other half. -- 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. From owner-freebsd-geom@FreeBSD.ORG Fri Mar 26 03:43:44 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 DB22016A4CE; Fri, 26 Mar 2004 03:43:44 -0800 (PST) Received: from darkness.comp.waw.pl (unknown [195.117.238.236]) by mx1.FreeBSD.org (Postfix) with ESMTP id 86CDC43D41; Fri, 26 Mar 2004 03:43:44 -0800 (PST) (envelope-from pjd@darkness.comp.waw.pl) Received: by darkness.comp.waw.pl (Postfix, from userid 1009) id 843B9ACADB; Fri, 26 Mar 2004 12:43:43 +0100 (CET) Date: Fri, 26 Mar 2004 12:43:43 +0100 From: Pawel Jakub Dawidek To: Poul-Henning Kamp Message-ID: <20040326114343.GG8930@darkness.comp.waw.pl> References: <20040326113251.GE8930@darkness.comp.waw.pl> <1979.1080300848@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jk5HhkA9Kov5Oxsi" Content-Disposition: inline In-Reply-To: <1979.1080300848@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 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:43:45 -0000 --jk5HhkA9Kov5Oxsi Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Mar 26, 2004 at 12:34:08PM +0100, Poul-Henning Kamp wrote: +> >Anyway this will be a big change. +>=20 +> No it isn't. Hmm, we can simulate such functionality, by doing only tests (can we remove this geom? Yes - block geom, return 0; No - unblock all geoms, return an error) in *_destroy_geom() function and do real removals in *_fini(). We block geoms to avoid races between _destroy_geom and _fini, but I'm not sure race is possible there. --=20 Pawel Jakub Dawidek http://www.FreeBSD.org pjd@FreeBSD.org http://garage.freebsd.pl FreeBSD committer Am I Evil? Yes, I Am! --jk5HhkA9Kov5Oxsi Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAZBdvForvXbEpPzQRAoLLAJ4kc9zISHRwxXLY1HAhgVne9TYpWACfdou3 ooBFW/YCVf3UexVNH2OO8e0= =oX/V -----END PGP SIGNATURE----- --jk5HhkA9Kov5Oxsi-- From owner-freebsd-geom@FreeBSD.ORG Fri Mar 26 03:48:38 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 CA72C16A4CE; Fri, 26 Mar 2004 03:48:38 -0800 (PST) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3546F43D2F; Fri, 26 Mar 2004 03:48:38 -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 i2QBmbAZ002249; Fri, 26 Mar 2004 12:48:37 +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:43:43 +0100." <20040326114343.GG8930@darkness.comp.waw.pl> Date: Fri, 26 Mar 2004 12:48:37 +0100 Message-ID: <2248.1080301717@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:48:39 -0000 In message <20040326114343.GG8930@darkness.comp.waw.pl>, Pawel Jakub Dawidek wr ites: > >--jk5HhkA9Kov5Oxsi >Content-Type: text/plain; charset=iso-8859-2 >Content-Disposition: inline >Content-Transfer-Encoding: quoted-printable > >On Fri, Mar 26, 2004 at 12:34:08PM +0100, Poul-Henning Kamp wrote: >+> >Anyway this will be a big change. >+>=20 >+> No it isn't. > >Hmm, we can simulate such functionality, by doing only tests >(can we remove this geom? Yes - block geom, return 0; >No - unblock all geoms, return an error) in *_destroy_geom() >function and do real removals in *_fini(). No, that is not what _fini is for. The solution would be to give destroy_geom() and argument which can be one of three values: TEST COMMIT ABANDON This is classical CS theory, there is no need to reinvent the hot water or the deep plate. -- 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. From owner-freebsd-geom@FreeBSD.ORG Fri Mar 26 04:07:54 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 4BC0C16A4CE; Fri, 26 Mar 2004 04:07:54 -0800 (PST) Received: from pasmtp.tele.dk (pasmtp.tele.dk [193.162.159.95]) by mx1.FreeBSD.org (Postfix) with ESMTP id CD42B43D1D; Fri, 26 Mar 2004 04:07:53 -0800 (PST) (envelope-from xride@x12.dk) Received: from x12.dk (xforce.dk [80.164.11.218]) by pasmtp.tele.dk (Postfix) with ESMTP id 873751EC37B; Fri, 26 Mar 2004 13:07:51 +0100 (CET) Received: by x12.dk (Postfix, from userid 666) id 6E8D24D; Fri, 26 Mar 2004 13:07:51 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by x12.dk (Postfix) with ESMTP id 5C9F126; Fri, 26 Mar 2004 13:07:51 +0100 (CET) Date: Fri, 26 Mar 2004 13:07:51 +0100 (CET) From: Soeren Straarup To: Poul-Henning Kamp In-Reply-To: <2248.1080301717@critter.freebsd.dk> Message-ID: <20040326125709.P7009-100000@x12.dk> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: geom@FreeBSD.org cc: Pawel Jakub Dawidek 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 12:07:54 -0000 Here is my two cents, seen with a new mind: On Fri, 26 Mar 2004, Poul-Henning Kamp wrote: > In message <20040326114343.GG8930@darkness.comp.waw.pl>, Pawel Jakub Dawidek wr > ites: > >On Fri, Mar 26, 2004 at 12:34:08PM +0100, Poul-Henning Kamp wrote: > >+> >Anyway this will be a big change. > >+>=20 > >+> No it isn't. > > > >Hmm, we can simulate such functionality, by doing only tests > >(can we remove this geom? Yes - block geom, return 0; > >No - unblock all geoms, return an error) in *_destroy_geom() > >function and do real removals in *_fini(). > > No, that is not what _fini is for. > Is there a _test_destroy_geom() ? for test purpose. > The solution would be to give destroy_geom() and argument > which can be one of three values: > TEST > COMMIT > ABANDON One way is to test everything if it is blocked by others, if not block it. When reached the end of the list, check if anything was bloacked by others. If so unblock what we blocked and return an error, else commit > > This is classical CS theory, there is no need to reinvent > the hot water or the deep plate. > I'm trying to get an idea of the geom layer. And just trying to come up with ideas. Soeren Straarup | aka OZ2DAK aka Xride FreeBSD wannabe | FreeBSD since 2.2.6-R My brain is on vacation.. From owner-freebsd-geom@FreeBSD.ORG Fri Mar 26 04:11:06 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 C2FD816A4CE; Fri, 26 Mar 2004 04:11:06 -0800 (PST) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id E4B4943D3F; Fri, 26 Mar 2004 04:11:05 -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 i2QCB3Zl002621; Fri, 26 Mar 2004 13:11:03 +0100 (CET) (envelope-from phk@phk.freebsd.dk) To: Soeren Straarup From: "Poul-Henning Kamp" In-Reply-To: Your message of "Fri, 26 Mar 2004 13:07:51 +0100." <20040326125709.P7009-100000@x12.dk> Date: Fri, 26 Mar 2004 13:11:03 +0100 Message-ID: <2620.1080303063@critter.freebsd.dk> cc: geom@FreeBSD.org cc: Pawel Jakub Dawidek 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 12:11:06 -0000 In message <20040326125709.P7009-100000@x12.dk>, Soeren Straarup writes: > >Here is my two cents, seen with a new mind: > >[...] > > My brain is on vacation.. You really need to be more careful with your .signature :-) -- 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.