Module Name:    src
Committed By:   jdolecek
Date:           Mon Feb 24 20:47:47 UTC 2020

Modified Files:
        src/sys/kern: init_main.c

Log Message:
move config_init_mi() call before vfsinit(), which can trigger loading
of VFS modules

fixes crash with LOCKDEBUG due to uninitialized mutex when zfs
module is loaded in boot, because zfs's spa_init() calls config_mountroot()
which now requires the config init having been done


To generate a diff of this commit:
cvs rdiff -u -r1.521 -r1.522 src/sys/kern/init_main.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/init_main.c
diff -u src/sys/kern/init_main.c:1.521 src/sys/kern/init_main.c:1.522
--- src/sys/kern/init_main.c:1.521	Tue Feb 18 20:23:17 2020
+++ src/sys/kern/init_main.c	Mon Feb 24 20:47:47 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: init_main.c,v 1.521 2020/02/18 20:23:17 chs Exp $	*/
+/*	$NetBSD: init_main.c,v 1.522 2020/02/24 20:47:47 jdolecek Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009, 2019 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.521 2020/02/18 20:23:17 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.522 2020/02/24 20:47:47 jdolecek Exp $");
 
 #include "opt_ddb.h"
 #include "opt_inet.h"
@@ -466,6 +466,9 @@ main(void)
 	/* Second part of module system initialization. */
 	module_start_unload_thread();
 
+	/* Initialize autoconf data structures before any modules are loaded */
+	config_init_mi();
+
 	/* Initialize the file systems. */
 #ifdef NVNODE_IMPLICIT
 	/*
@@ -743,8 +746,6 @@ static void
 configure(void)
 {
 
-	/* Initialize autoconf data structures. */
-	config_init_mi();
 	/*
 	 * XXX
 	 * callout_setfunc() requires mutex(9) so it can't be in config_init()

Reply via email to