git: bcd8cd859e69 - main - buf: Make buf_daemon_shutdown() a no-op after a panic

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Wed, 01 Mar 2023 15:16:26 UTC
The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=bcd8cd859e694bc4a4dfb6fdb8f55de3a96833b4

commit bcd8cd859e694bc4a4dfb6fdb8f55de3a96833b4
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2023-03-01 15:07:56 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2023-03-01 15:15:54 +0000

    buf: Make buf_daemon_shutdown() a no-op after a panic
    
    As in commit 9d7cc536e261a7, there is no need to do anything in this
    context.
    
    MFC after:      1 week
---
 sys/kern/vfs_bio.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index b40ee382c42a..f1089964a041 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -3419,6 +3419,9 @@ buf_daemon_shutdown(void *arg __unused, int howto __unused)
 {
 	int error;
 
+	if (KERNEL_PANICKED())
+		return;
+
 	mtx_lock(&bdlock);
 	bd_shutdown = true;
 	wakeup(&bd_request);