If the kernel panic'd while holding the NET_LOCK(), typing "boot reboot"
wont work.  The problem is that if_downall() called in boot() tries to
grab the NET_LOCK().

Can we tell rw_enter() to try his best after a panic?  This fix my
NET_LOCK() debugging experience.

ok?

Index: kern/kern_rwlock.c
===================================================================
RCS file: /cvs/src/sys/kern/kern_rwlock.c,v
retrieving revision 1.28
diff -u -p -r1.28 kern_rwlock.c
--- kern/kern_rwlock.c  20 Apr 2017 13:33:00 -0000      1.28
+++ kern/kern_rwlock.c  9 Aug 2017 13:58:47 -0000
@@ -236,6 +236,10 @@ retry:
                unsigned long set = o | op->wait_set;
                int do_sleep;
 
+               /* Avoid deadlocks after panic */
+               if (panicstr)
+                       return (0);
+
                rw_enter_diag(rwl, flags);
 
                if (flags & RW_NOSLEEP)

Reply via email to