Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Jan 2003 14:47:10 -0800
From:      "Eugene M. Kim" <ab@astralblue.net>
To:        Greg Lehey <grog@FreeBSD.ORG>
Cc:        "Daniel O'Connor" <doconnor@gsoft.com.au>, David Schultz <dschultz@uclink.berkeley.edu>, Nate Lawson <nate@root.org>, current@FreeBSD.ORG
Subject:   Re: I've just had a massive file system crash
Message-ID:  <20030126224710.GA4160@purple.the-7.net>
In-Reply-To: <20030126080830.GE1606@sydney.worldwide.lemis.com>
References:  <20030125070352.GA933@HAL9000.homeunix.com> <Pine.BSF.4.21.0301251048090.79988-100000@root.org> <20030125213859.GB6339@HAL9000.homeunix.com> <1043553241.85148.191.camel@chowder.dons.net.au> <20030126080830.GE1606@sydney.worldwide.lemis.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--WYTEVAkct0FjGQmd
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Sun, Jan 26, 2003 at 04:08:31PM +0800, Greg Lehey wrote:
> On Sunday, 26 January 2003 at 14:24:02 +1030, Daniel O'Connor wrote:
> > On Sun, 2003-01-26 at 08:08, David Schultz wrote:
> >> Good.  I was referring to IDE in this case, because I assume
> >> that's what Greg's laptop uses.  The ATA driver flushes the cache
> >> when the device is closed, but I don't think that happens during
> >> shutdown.  It probably needs to register a shutdown hook like the
> >> SCSI driver.  Also, the driver is a bit optimistic about how long
> >> the flush will take; it times out after 5 seconds, whereas the ATA
> >> spec says a flush can take up to 30 seconds.
> >
> > I am wondering if I experienced this problem with my -stable laptop..
> >
> > I shut it down and then booted it up later to find fsck having a nice
> > good chew on the drive (deleting REAMS of files).
> 
> Did you use shutdown -p?  If my hypothesis is correct, it's possible
> to get this result with shutdown -h if you press the power switch as
> soon as the "System halted" message appears, but normally you'd give
> it a few seconds longer.  With shutdown -p, it's immediate, modulo
> delay.

Just a random idea: If that poses an issue, how about this patch?

Eugene

--WYTEVAkct0FjGQmd
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="patch-src::sys::kern::kern_shutdown.c"

--- src/sys/kern_shutdown.c	Sun Jan 26 14:24:56 2003
+++ src/sys/kern_shutdown.c.new	Sun Jan 26 14:25:42 2003
@@ -545,7 +545,7 @@
 static void 
 poweroff_wait(void *junk, int howto)
 {
-	if(!(howto & RB_POWEROFF) || poweroff_delay <= 0)
+	if(!(howto & (RB_POWEROFF | RB_HALT)) || poweroff_delay <= 0)
 		return;
 	DELAY(poweroff_delay * 1000);
 }

--WYTEVAkct0FjGQmd--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030126224710.GA4160>