summaryrefslogtreecommitdiffstats
path: root/sys/geom/geom_subr.c
diff options
context:
space:
mode:
authorgreen <green@FreeBSD.org>2004-10-12 04:44:54 +0000
committergreen <green@FreeBSD.org>2004-10-12 04:44:54 +0000
commitc125751bac1ccd273f7990f5732fef219daab464 (patch)
tree548a0c1ee755914acd0774de479902ad2448d7c0 /sys/geom/geom_subr.c
parent6e49d517bf4371359508d13c8e12d17d67ed0b34 (diff)
downloadFreeBSD-src-c125751bac1ccd273f7990f5732fef219daab464.zip
FreeBSD-src-c125751bac1ccd273f7990f5732fef219daab464.tar.gz
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
Diffstat (limited to 'sys/geom/geom_subr.c')
-rw-r--r--sys/geom/geom_subr.c10
1 files changed, 9 insertions, 1 deletions
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:
OpenPOWER on IntegriCloud