From owner-freebsd-current Mon Nov 25 15:41:35 2002 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 6C0C337B401; Mon, 25 Nov 2002 15:41:33 -0800 (PST) Received: from flamingo.mail.pas.earthlink.net (flamingo.mail.pas.earthlink.net [207.217.120.232]) by mx1.FreeBSD.org (Postfix) with ESMTP id E94DC43EC2; Mon, 25 Nov 2002 15:41:32 -0800 (PST) (envelope-from tlambert2@mindspring.com) Received: from pool0340.cvx40-bradley.dialup.earthlink.net ([216.244.43.85] helo=mindspring.com) by flamingo.mail.pas.earthlink.net with esmtp (Exim 3.33 #1) id 18GSoV-0000d6-00; Mon, 25 Nov 2002 15:38:51 -0800 Message-ID: <3DE2B43B.466FEA99@mindspring.com> Date: Mon, 25 Nov 2002 15:37:31 -0800 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Brad Knowles Cc: Kris Kennaway , Robert Watson , Mikhail Teterin , current@FreeBSD.ORG Subject: Re: -current unusable after a crash References: <200211250959.39594.mi+mx@aldan.algebra.com> <20021125172445.GA8953@rot13.obsecurity.org> <3DE29DE6.CDD96F3F@mindspring.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 Brad Knowles wrote: > At 2:02 PM -0800 2002/11/25, Terry Lambert wrote: > > If you made system dumps mandatory (or marked swap with a non-dump > > header in case of panic), this still would not handle the "silent > > reboot", "double panic", or "single panic with disk I/O trashed" > > cases. 8-(. > > How about we do the safe thing, and only do background fsck if we > can prove that the system state is something where it would be > suitable? Or would that mean that we almost never do background fsck? It would mean that you can *never* background fsck safely. The problem is that you need to distinguish a power failure, which is technically the only safe time to do it, from all other failure modes. You can distinguish, at least on R/W FS's, whether or not to do any fsck (by looking at the "clean" bit), but all other bets are off. One approach that works well for desktop systems is to implement a "soft read-only". We did this at Artisoft in 1995/1996, when we ported the VFS stacking framework to Windows 95, and first implemented a soft updates for FFS/UFS, which we ported to run on Windows 95 under the stacking framework. The way a "soft read-only" works is to leave the FS mounted read/write, and then insert at write attempts, everywhere that read-only is checked, a check for a "soft read-only" bit on the in-core superblock. Basically, we flush out all writeable state to the FS, and then set the clean bit in the superblock, and flush it to disk, if I/O on the FS has been idle for a while. Then, when someone wants to write it, we reset the "dirty" bit, flush the superblock back out to disk, and, once we know that the change has been committed to stable storage, we permit the write operation to continue. There's actually some problems that now exist in the sync code in FreeBSD that result in unnecessary writes to the disk, these days, which make it hard to implement this (the system basically sync's disk buffers that don't need to be sync'ed, at intervals); that would have to be fixed before such a system can be used. The result is a box you can just "turn off", without trashing the FS, assuming it's relatively quiescent, relative to FS writes (e.g. desktop systems, as I said at the top). Similarly, if the system were to panic, lose power, whatever, at this point, then the FS's would be clean, and come back up with no need to fsck. -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message