Source-Changes-HG archive

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

[src/trunk]: src/sys/kern shutdown_all: take kernel_lock now that kern_reboot...



details:   https://anonhg.NetBSD.org/src/rev/2ab5d43ab0e9
branches:  trunk
changeset: 745166:2ab5d43ab0e9
user:      ad <ad%NetBSD.org@localhost>
date:      Sun Feb 23 20:08:35 2020 +0000

description:
shutdown_all: take kernel_lock now that kern_reboot() doesn't.

diffstat:

 sys/kern/kern_pmf.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (34 lines):

diff -r d80624cd9c24 -r 2ab5d43ab0e9 sys/kern/kern_pmf.c
--- a/sys/kern/kern_pmf.c       Sun Feb 23 20:06:30 2020 +0000
+++ b/sys/kern/kern_pmf.c       Sun Feb 23 20:08:35 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_pmf.c,v 1.40 2018/04/08 11:46:13 mlelstv Exp $ */
+/* $NetBSD: kern_pmf.c,v 1.41 2020/02/23 20:08:35 ad Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_pmf.c,v 1.40 2018/04/08 11:46:13 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_pmf.c,v 1.41 2020/02/23 20:08:35 ad Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -351,6 +351,7 @@
        device_t curdev;
        bool progress = false;
 
+       KERNEL_LOCK(1, NULL);
        for (curdev = shutdown_first(&s); curdev != NULL;
             curdev = shutdown_next(&s)) {
                aprint_debug(" shutting down %s, ", device_xname(curdev));
@@ -369,6 +370,7 @@
                        aprint_debug("success.");
                }
        }
+       KERNEL_UNLOCK_ONE(NULL);
        return progress;
 }
 



Home | Main Index | Thread Index | Old Index