Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern move config_init_mi() call before vfsinit(), which ...



details:   https://anonhg.NetBSD.org/src/rev/0fb9c5f1ca00
branches:  trunk
changeset: 745193:0fb9c5f1ca00
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Mon Feb 24 20:47:47 2020 +0000

description:
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

diffstat:

 sys/kern/init_main.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (37 lines):

diff -r 9b46e0552646 -r 0fb9c5f1ca00 sys/kern/init_main.c
--- a/sys/kern/init_main.c      Mon Feb 24 20:44:25 2020 +0000
+++ b/sys/kern/init_main.c      Mon Feb 24 20:47:47 2020 +0000
@@ -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 @@
        /* 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 @@
 configure(void)
 {
 
-       /* Initialize autoconf data structures. */
-       config_init_mi();
        /*
         * XXX
         * callout_setfunc() requires mutex(9) so it can't be in config_init()



Home | Main Index | Thread Index | Old Index