From c125751bac1ccd273f7990f5732fef219daab464 Mon Sep 17 00:00:00 2001 From: green Date: Tue, 12 Oct 2004 04:44:54 +0000 Subject: When loading GEOM modules, we expect the actual load process to be done by the time that kldload(8) returns. Satisfy that by making the GEOM module load event -- only when the kernel is !cold -- wait until the GEOM module init function has finished instead of returning immediately. This is the other half of fixing md(8) (actually, "mfs" in fstab(5)) that is similar to r1.128 of src/sys/dev/md/md.c. This bug would be why RAM disks would often fail on boot and the first call to mdconfig(8) would probably fail. pjd has ideas for not requiring kldload(8) to work synchronously for control devices that could make this obsolete. Silence on: -arch --- sys/geom/geom_subr.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'sys/geom/geom_subr.c') diff --git a/sys/geom/geom_subr.c b/sys/geom/geom_subr.c index 3085c4b..6fe50f9 100644 --- a/sys/geom/geom_subr.c +++ b/sys/geom/geom_subr.c @@ -195,7 +195,15 @@ g_modevent(module_t mod, int type, void *data) switch (type) { case MOD_LOAD: g_trace(G_T_TOPOLOGY, "g_modevent(%s, LOAD)", hh->mp->name); - g_post_event(g_load_class, hh, M_WAITOK, NULL); + /* + * Once the system is not cold, MOD_LOAD calls will be + * from the userland and the g_event thread will be able + * to acknowledge their completion. + */ + if (cold) + g_post_event(g_load_class, hh, M_WAITOK, NULL); + else + g_waitfor_event(g_load_class, hh, M_WAITOK, NULL); error = 0; break; case MOD_UNLOAD: -- cgit v1.1