diff options
author | Mitchell Horne <mhorne@FreeBSD.org> | 2023-11-23 15:25:54 +0000 |
---|---|---|
committer | Mitchell Horne <mhorne@FreeBSD.org> | 2023-11-23 16:07:42 +0000 |
commit | 9d61fd08499609a2c95d1c66f97587932b446f06 (patch) | |
tree | 988a3907f8b3d4414936cac3b61c2fde6d814e6e | |
parent | d79a9edb5ce162c1ba49e12e5c93b894e6a25ad2 (diff) | |
download | src-9d61fd08499609a2c95d1c66f97587932b446f06.tar.gz src-9d61fd08499609a2c95d1c66f97587932b446f06.zip |
ctl_ha: don't shutdown threads if scheduler is stopped
In this case, just return.
Reviewed by: markj
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D42341
-rw-r--r-- | sys/cam/ctl/ctl_ha.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/cam/ctl/ctl_ha.c b/sys/cam/ctl/ctl_ha.c index 181f42640cce..0828c46c8863 100644 --- a/sys/cam/ctl/ctl_ha.c +++ b/sys/cam/ctl/ctl_ha.c @@ -909,13 +909,16 @@ ctl_ha_msg_shutdown(struct ctl_softc *ctl_softc) { struct ha_softc *softc = &ha_softc; + if (SCHEDULER_STOPPED()) + return; + /* Disconnect and shutdown threads. */ mtx_lock(&softc->ha_lock); if (softc->ha_shutdown < 2) { softc->ha_shutdown = 1; softc->ha_wakeup = 1; wakeup(&softc->ha_wakeup); - while (softc->ha_shutdown < 2 && !SCHEDULER_STOPPED()) { + while (softc->ha_shutdown < 2) { msleep(&softc->ha_wakeup, &softc->ha_lock, 0, "shutdown", hz); } |