Sun Jan 3 12:51:33 2021 UTC ()
Apply patch, requested by khorben in ticket #1177 (issue solved differently
in -current):

	sys/kern/init_main.c			(apply patch)

PR kern/55906: create the aiodone workqueue before running mountroothooks.


(martin)
diff -r1.504.2.1 -r1.504.2.2 src/sys/kern/init_main.c

cvs diff -r1.504.2.1 -r1.504.2.2 src/sys/kern/init_main.c (expand / switch to context diff)
--- src/sys/kern/init_main.c 2020/11/14 15:36:11 1.504.2.1
+++ src/sys/kern/init_main.c 2021/01/03 12:51:33 1.504.2.2
@@ -1,4 +1,4 @@
-/*	$NetBSD: init_main.c,v 1.504.2.1 2020/11/14 15:36:11 martin Exp $	*/
+/*	$NetBSD: init_main.c,v 1.504.2.2 2021/01/03 12:51:33 martin Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.504.2.1 2020/11/14 15:36:11 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.504.2.2 2021/01/03 12:51:33 martin Exp $");
 
 #include "opt_ddb.h"
 #include "opt_inet.h"
@@ -668,6 +668,11 @@
 	cpu_rootconf();
 	cpu_dumpconf();
 
+	/* Create the aiodone daemon kernel thread. */
+	if (workqueue_create(&uvm.aiodone_queue, "aiodoned",
+	    uvm_aiodone_worker, NULL, PRI_VM, IPL_NONE, WQ_MPSAFE))
+		panic("fork aiodoned");
+
 	/* Mount the root file system. */
 	do {
 		domountroothook(root_device);
@@ -735,11 +740,6 @@
 	if (kthread_create(PRI_IOFLUSH, KTHREAD_MPSAFE, NULL, sched_sync,
 	    NULL, NULL, "ioflush"))
 		panic("fork syncer");
-
-	/* Create the aiodone daemon kernel thread. */
-	if (workqueue_create(&uvm.aiodone_queue, "aiodoned",
-	    uvm_aiodone_worker, NULL, PRI_VM, IPL_NONE, WQ_MPSAFE))
-		panic("fork aiodoned");
 
 	/* Wait for final configure threads to complete. */
 	config_finalize_mountroot();