Problem with g_unload_class()

Poul-Henning Kamp phk at phk.freebsd.dk
Fri Mar 26 03:18:14 PST 2004


In message <20040326110046.GD8930 at 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 at 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.


More information about the freebsd-geom mailing list