Current GEOM problems.
Poul-Henning Kamp
phk at phk.freebsd.dk
Thu Jul 8 10:15:45 PDT 2004
In message <20040707012904.GP12007 at darkness.comp.waw.pl>, Pawel Jakub Dawidek w
rites:
>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_geom()
> will be called for the same geom it will panic, because gp->softc is
> NULL.
can you try this untested patch ?
Index: geom_slice.c
===================================================================
RCS file: /home/ncvs/src/sys/geom/geom_slice.c,v
retrieving revision 1.54
diff -u -r1.54 geom_slice.c
--- geom_slice.c 4 Jul 2004 13:44:48 -0000 1.54
+++ geom_slice.c 8 Jul 2004 17:15:12 -0000
@@ -439,8 +439,13 @@
int
g_slice_destroy_geom(struct gctl_req *req, struct g_class *mp, struct g_geom *gp)
{
+ struct g_slicer *gsp;
- g_slice_spoiled(LIST_FIRST(&gp->consumer));
+ g_topology_assert();
+ gsp = gp->softc;
+ gp->softc = NULL;
+ g_slice_free(gsp);
+ g_wither_geom(gp, ENXIO);
return (0);
}
--
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