From owner-freebsd-bugs Sun Jan 24 05:40:02 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id FAA03887 for freebsd-bugs-outgoing; Sun, 24 Jan 1999 05:40:02 -0800 (PST) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id FAA03820 for ; Sun, 24 Jan 1999 05:39:59 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id FAA18475; Sun, 24 Jan 1999 05:40:01 -0800 (PST) Received: (from nobody@localhost) by hub.freebsd.org (8.8.8/8.8.8) id FAA03274; Sun, 24 Jan 1999 05:35:46 -0800 (PST) (envelope-from nobody) Message-Id: <199901241335.FAA03274@hub.freebsd.org> Date: Sun, 24 Jan 1999 05:35:46 -0800 (PST) From: rock@cs.uni-sb.de To: freebsd-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: www-1.0 Subject: kern/9664: unclean file system after halt -p Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 9664 >Category: kern >Synopsis: unclean file system after halt -p >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Jan 24 05:40:00 PST 1999 >Closed-Date: >Last-Modified: >Originator: Daniel Rock >Release: 4.0-current >Organization: >Environment: >Description: On at least one machine the power is cut too fast in the shutdown routine. The superblock (and maybe others) aren't flushed to disk, forcing a fsck on next reboot. >How-To-Repeat: Depends on hardware configuration. My configuration: Maxtor DiamondMax (90432D2) IDE drive Asus SP98 mainboard. >Fix: Add a sysctl variable where you can specify a shutdown delay before cutting the power: Index: sys/kern/kern_shutdown.c =================================================================== RCS file: /data/cvs/src/sys/kern/kern_shutdown.c,v retrieving revision 1.44 diff -c -r1.44 kern_shutdown.c *** kern_shutdown.c 1998/12/28 23:03:00 1.44 --- kern_shutdown.c 1999/01/24 13:18:24 *************** *** 88,93 **** --- 88,95 ---- &debugger_on_panic, 0, ""); #endif + SYSCTL_NODE(_kern, OID_AUTO, shutdown, CTLFLAG_RW, 0, "Shutdown environment"); + #ifdef HW_WDOG /* * If there is a hardware watchdog, point this at the function needed to Index: sys/i386/apm/apm.c =================================================================== RCS file: /data/cvs/src/sys/i386/apm/apm.c,v retrieving revision 1.77 diff -c -r1.77 apm.c *** apm.c 1998/12/10 23:36:14 1.77 --- apm.c 1999/01/24 13:10:49 *************** *** 38,43 **** --- 38,44 ---- #include #include #include + #include #include #ifdef VM86 *************** *** 69,74 **** --- 70,80 ---- static struct apm_softc apm_softc; static struct apmhook *hook[NAPM_HOOK]; /* XXX */ + /* delay (in ms) to turn power of after shutdown */ + static int poweroff_delay = 0; + SYSCTL_INT(_kern_shutdown, OID_AUTO, poweroff_delay, CTLFLAG_RW, + &poweroff_delay, 0, ""); + #define is_enabled(foo) ((foo) ? "enabled" : "disabled") /* Map version number to integer (keeps ordering of version numbers) */ *************** *** 254,259 **** --- 260,267 ---- /* Not halting powering off, or not active */ if (!(howto & RB_POWEROFF) || !apm_softc.active) return; + if(poweroff_delay > 0) + DELAY(poweroff_delay * 1000); eax = (APM_BIOS << 8) | APM_SETPWSTATE; ebx = PMDV_ALLDEV; ecx = PMST_OFF; >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message