GEOM modules don't wait for "init" completion

Brian Fundakowski Feldman green at FreeBSD.org
Tue Oct 5 21:09:48 PDT 2004


On Tue, Oct 05, 2004 at 08:05:45PM -0400, Brian Fundakowski Feldman wrote:
> In src/sys/geom/geom_subr.c, g_modevent(MOD_LOAD) does not wait for
> completion of the class's initialization before proceeding to return
> success to the caller (kldload(8)).  This is especially problematic
> for mount_mfs(8)'s use of mdctl(8) -- the first mount hardly ever
> succeeds.  Does it not seem like this line:
	if (cold)
> 		g_post_event(g_load_class, hh, M_WAITOK, NULL);
> should really be:
	if (!cold)
> 		g_waitfor_event(g_load_class, hh, M_WAITOK, NULL);
> ?
> 
> I can't really envision situations where you would at least not want to
> have your control device exist before returning from a kldload(2) system
> call.

Okay, that was the easy answer why not to do it... but changing it
so that it does g_waitfor_event() when it's !cold seems to work fine,
even if I'd prefer the logic to go somewhere deeper than that...

-- 
Brian Fundakowski Feldman                           \'[ FreeBSD ]''''''''''\
  <> green at FreeBSD.org                               \  The Power to Serve! \
 Opinions expressed are my own.                       \,,,,,,,,,,,,,,,,,,,,,,\


More information about the freebsd-arch mailing list