Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Oct 2004 00:09:38 -0400
From:      Brian Fundakowski Feldman <green@FreeBSD.org>
To:        arch@FreeBSD.org
Cc:        phk@FreeBSD.org
Subject:   Re: GEOM modules don't wait for "init" completion
Message-ID:  <20041006040938.GH47017@green.homeunix.org>
In-Reply-To: <20041006000545.GG47017@green.homeunix.org>
References:  <20041006000545.GG47017@green.homeunix.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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@FreeBSD.org                               \  The Power to Serve! \
 Opinions expressed are my own.                       \,,,,,,,,,,,,,,,,,,,,,,\



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041006040938.GH47017>