From owner-freebsd-current Sat Jan 25 13:39: 7 2003 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 72E0437B401 for ; Sat, 25 Jan 2003 13:39:06 -0800 (PST) Received: from HAL9000.homeunix.com (12-233-57-224.client.attbi.com [12.233.57.224]) by mx1.FreeBSD.org (Postfix) with ESMTP id C519C43ED8 for ; Sat, 25 Jan 2003 13:39:05 -0800 (PST) (envelope-from dschultz@uclink.Berkeley.EDU) Received: from HAL9000.homeunix.com (localhost [127.0.0.1]) by HAL9000.homeunix.com (8.12.6/8.12.5) with ESMTP id h0PLcx0A006549; Sat, 25 Jan 2003 13:39:05 -0800 (PST) (envelope-from dschultz@uclink.Berkeley.EDU) Received: (from das@localhost) by HAL9000.homeunix.com (8.12.6/8.12.5/Submit) id h0PLcx1Q006548; Sat, 25 Jan 2003 13:38:59 -0800 (PST) (envelope-from dschultz@uclink.Berkeley.EDU) Date: Sat, 25 Jan 2003 13:38:59 -0800 From: David Schultz To: Nate Lawson Cc: current@FreeBSD.ORG Subject: Re: I've just had a massive file system crash Message-ID: <20030125213859.GB6339@HAL9000.homeunix.com> Mail-Followup-To: Nate Lawson , current@FreeBSD.ORG References: <20030125070352.GA933@HAL9000.homeunix.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Thus spake Nate Lawson : > On Fri, 24 Jan 2003, David Schultz wrote: > > Thus spake Greg Lehey : > > > I've been thinking about what happened, and I have a possibility: the > > > session before shutdown included a lot of writing to that file system, > > > and I did a shutdown -p. It's possible that the shutdown powered off > > > the system before the disk had flushed its cache. For the moment I'm > > > avoiding shutdown -p, but when I get home I'll try to provoke it > > > again. > > > > FreeBSD's ``fix'' for this problem is the same as Windows 98's. > > Specifically, there is a 5-second delay (tuneable: > > kern.shutdown.poweroff_delay) after all buffers are flushed but > > before the power is cut. Maybe we ought to be sending FLUSH > > CACHE commands to all drives and waiting for them to finish. > > da(4) does a SYNC CACHE (see daclose() and dashutdown()). 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. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message