Current GEOM problems.

Pawel Jakub Dawidek pjd at FreeBSD.org
Thu Jul 8 11:19:11 PDT 2004


On Thu, Jul 08, 2004 at 07:15:43PM +0200, Poul-Henning Kamp wrote:
+> >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 ?

Nope, it doesn't work. I'll try to explain the problem more precise.

When g_wither_geom() is called from g_unload_class() via destroy_geom
method AND provider exists on this geom we can choose: panic or deadlock,
because:
- g_unload_class() is called from the event queue in blocking mode.
- g_wither_geom() calls g_orphan_provider().
- g_orphan_provider() sends event, but the event queue is blocked,
  so provider can't be destroyed, so geom can't be withered.
- g_unload_class() tries to destroy this geom in loop, but it can't be
  definitely destroyed.

The simplest solution which cames to my mind is to skip geoms that are
marked as beeing withered in g_unload_class().

BTW. You reproduce this panic by doing:

	# glabel create foo <some_provider>
	# glabel unload

-- 
Pawel Jakub Dawidek                       http://www.FreeBSD.org
pjd at FreeBSD.org                           http://garage.freebsd.pl
FreeBSD committer                         Am I Evil? Yes, I Am!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-geom/attachments/20040708/09e118dc/attachment.bin


More information about the freebsd-geom mailing list