Index: geom_subr.c =================================================================== RCS file: /private/FreeBSD/src/sys/geom/geom_subr.c,v retrieving revision 1.72 diff -u -p -r1.72 geom_subr.c --- geom_subr.c 7 Mar 2004 17:33:15 -0000 1.72 +++ geom_subr.c 8 Mar 2004 01:42:09 -0000 @@ -117,7 +117,7 @@ g_unload_class(void *arg, int flag) { struct g_hh00 *hh; struct g_class *mp; - struct g_geom *gp; + struct g_geom *gp, *gp2; struct g_provider *pp; struct g_consumer *cp; int error; @@ -155,7 +155,10 @@ g_unload_class(void *arg, int flag) mp->config = NULL; error = 0; - LIST_FOREACH(gp, &mp->geom, geom) { + /* + * Don't be surprised if geom self-destruct. + */ + LIST_FOREACH_SAFE(gp, &mp->geom, geom, gp2) { error = mp->destroy_geom(NULL, mp, gp); if (error != 0) break;