From owner-freebsd-arch@FreeBSD.ORG Wed Oct 6 04:09:48 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from green.homeunix.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id D860016A4CE; Wed, 6 Oct 2004 04:09:47 +0000 (GMT) Received: from green.homeunix.org (green@localhost [127.0.0.1]) by green.homeunix.org (8.13.1/8.13.1) with ESMTP id i9649ilA058473; Wed, 6 Oct 2004 00:09:44 -0400 (EDT) (envelope-from green@green.homeunix.org) Received: (from green@localhost) by green.homeunix.org (8.13.1/8.13.1/Submit) id i9649dEP058472; Wed, 6 Oct 2004 00:09:39 -0400 (EDT) (envelope-from green) Date: Wed, 6 Oct 2004 00:09:38 -0400 From: Brian Fundakowski Feldman To: arch@FreeBSD.org Message-ID: <20041006040938.GH47017@green.homeunix.org> References: <20041006000545.GG47017@green.homeunix.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041006000545.GG47017@green.homeunix.org> User-Agent: Mutt/1.5.6i cc: phk@FreeBSD.org Subject: Re: GEOM modules don't wait for "init" completion X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2004 04:09:48 -0000 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. \,,,,,,,,,,,,,,,,,,,,,,\