NetBSD-Bugs archive

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

Re: kern/52147: deadlock when booting from USB disk



On Apr 12, 11:20pm, mlelstv%serpens.de@localhost (Michael van Elst) wrote:
-- Subject: Re: kern/52147: deadlock when booting from USB disk

Looks like this should do it?

christos

Index: kern_module.c
===================================================================
RCS file: /cvsroot/src/sys/kern/kern_module.c,v
retrieving revision 1.123
diff -u -u -r1.123 kern_module.c
--- kern_module.c	11 Apr 2017 21:15:57 -0000	1.123
+++ kern_module.c	13 Apr 2017 00:04:02 -0000
@@ -609,7 +609,7 @@
 {
 	int error;
 
-	if (rootvp == NULL) {
+	if (rootvp == NULL || rootvp->v_mount == NULL) {
 #ifdef DIAGNOSTIC
 		printf("%s: trying to load `%s' before root is mounted\n",
 		    __func__, filename);
@@ -617,6 +617,14 @@
 		return EPERM;
 	}
 
+	if (fstrans_getstate(rootvp->v_vmount) != FSTRANS_NORMAL) {
+#ifdef DIAGNOSTIC
+		printf("%s: trying to load `%s' while root is suspended\n",
+		    __func__, filename);
+#endif
+		return EPERM;
+	}
+
 	kernconfig_lock();
 
 	/* Nothing if the user has disabled it. */


Home | Main Index | Thread Index | Old Index