aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/kern_alq.c
diff options
context:
space:
mode:
authorMitchell Horne <mhorne@FreeBSD.org>2023-11-23 15:25:30 +0000
committerMitchell Horne <mhorne@FreeBSD.org>2023-11-23 16:07:42 +0000
commitd79a9edb5ce162c1ba49e12e5c93b894e6a25ad2 (patch)
tree5930a3ed4fc18323d514785bedcb6737473902c3 /sys/kern/kern_alq.c
parent41e26e8288f1743c8584e5f9c461d36dce1cccc6 (diff)
downloadsrc-d79a9edb5ce162c1ba49e12e5c93b894e6a25ad2.tar.gz
src-d79a9edb5ce162c1ba49e12e5c93b894e6a25ad2.zip
alq, siftr: add panic/debugger checks to shutdown hooks
Don't try to gracefully terminate the pkt_manager thread if the scheduler is not running. We should not attempt to shutdown ald if RB_NOSYNC is set, and must not if the scheduler is stopped (the function calls wakeup()). Reviewed by: markj MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D42340
Diffstat (limited to 'sys/kern/kern_alq.c')
-rw-r--r--sys/kern/kern_alq.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/sys/kern/kern_alq.c b/sys/kern/kern_alq.c
index 51fd66f2fe9f..1bcce92509c5 100644
--- a/sys/kern/kern_alq.c
+++ b/sys/kern/kern_alq.c
@@ -37,19 +37,20 @@
#include <sys/param.h>
#include <sys/systm.h>
+#include <sys/alq.h>
+#include <sys/eventhandler.h>
+#include <sys/fcntl.h>
#include <sys/kernel.h>
#include <sys/kthread.h>
#include <sys/lock.h>
+#include <sys/malloc.h>
#include <sys/mount.h>
#include <sys/mutex.h>
#include <sys/namei.h>
#include <sys/proc.h>
-#include <sys/vnode.h>
-#include <sys/alq.h>
-#include <sys/malloc.h>
+#include <sys/reboot.h>
#include <sys/unistd.h>
-#include <sys/fcntl.h>
-#include <sys/eventhandler.h>
+#include <sys/vnode.h>
#include <security/mac/mac_framework.h>
@@ -228,6 +229,9 @@ ald_shutdown(void *arg, int howto)
{
struct alq *alq;
+ if ((howto & RB_NOSYNC) != 0 || SCHEDULER_STOPPED())
+ return;
+
ALD_LOCK();
/* Ensure no new queues can be created. */