Module Name:    src
Committed By:   nakayama
Date:           Tue Oct 28 13:04:51 UTC 2014

Modified Files:
        src/sys/arch/sparc64/sparc64: machdep.c

Log Message:
Sync cpu_reboot with i386:
- avoid sync and unmount after panic.
- remove vfs_shutdown, we call vfs_sync_all and vfs_unmount* instead.
- resurrect doshutdownhooks since some drivers still use it (eg. sab(4)).


To generate a diff of this commit:
cvs rdiff -u -r1.279 -r1.280 src/sys/arch/sparc64/sparc64/machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sparc64/sparc64/machdep.c
diff -u src/sys/arch/sparc64/sparc64/machdep.c:1.279 src/sys/arch/sparc64/sparc64/machdep.c:1.280
--- src/sys/arch/sparc64/sparc64/machdep.c:1.279	Sun Sep 21 16:37:34 2014
+++ src/sys/arch/sparc64/sparc64/machdep.c	Tue Oct 28 13:04:51 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.279 2014/09/21 16:37:34 christos Exp $ */
+/*	$NetBSD: machdep.c,v 1.280 2014/10/28 13:04:51 nakayama Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.279 2014/09/21 16:37:34 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.280 2014/10/28 13:04:51 nakayama Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -599,10 +599,13 @@ cpu_reboot(int howto, char *user_boot_st
 	 */
 	maybe_dump(howto);
 
-	if ((howto & RB_NOSYNC) == 0 && !syncdone) {
+	/*
+	 * If we've panic'd, don't make the situation potentially
+	 * worse by syncing or unmounting the file systems.
+	 */
+	if ((howto & RB_NOSYNC) == 0 && panicstr == NULL) {
 		if (!syncdone) {
-		syncdone = true;
-		vfs_shutdown();
+			syncdone = true;
 			/* XXX used to force unmount as well, here */
 			vfs_sync_all(l);
 			/*
@@ -630,6 +633,7 @@ cpu_reboot(int howto, char *user_boot_st
 	splhigh();
 
 haltsys:
+	doshutdownhooks();
 
 #ifdef MULTIPROCESSOR
 	/* Stop all secondary cpus */

Reply via email to