From owner-freebsd-hackers Sun Mar 19 08:21:12 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id IAA12427 for hackers-outgoing; Sun, 19 Mar 1995 08:21:12 -0800 Received: from Root.COM (implode.Root.COM [198.145.90.1]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id IAA12421 for ; Sun, 19 Mar 1995 08:21:09 -0800 Received: from corbin.Root.COM (corbin.Root.COM [198.145.90.18]) by Root.COM (8.6.8/8.6.5) with ESMTP id IAA23731; Sun, 19 Mar 1995 08:21:01 -0800 Received: from localhost (localhost [127.0.0.1]) by corbin.Root.COM (8.6.11/8.6.5) with SMTP id IAA02117; Sun, 19 Mar 1995 08:21:01 -0800 Message-Id: <199503191621.IAA02117@corbin.Root.COM> X-Authentication-Warning: corbin.Root.COM: Host localhost didn't use HELO protocol To: Remy.Card@masi.ibp.fr cc: hackers@FreeBSD.org Subject: Re: Filesystem clean flag In-reply-to: Your message of "Sun, 19 Mar 95 16:58:08 GMT." <199503191658.QAA00122@bbj.ibp.fr> From: David Greenman Reply-To: davidg@Root.COM Date: Sun, 19 Mar 1995 08:20:55 -0800 Sender: hackers-owner@FreeBSD.org Precedence: bulk > I am currently studying the filesystem kernel code and I think that >the current clean flag implementation could be improved. Currently, the >clean flag is set to 0 when a filesystem is mounted in read-write mode and >set to 1 when the filesystem is unmounted. This way of doing things can be >a problem in some cases: suppose that a system crashes (so the filesystems >are marked as not clean), the system is rebooted in single user mode (so >fsck is not run at boot), and then goes to multiuser mode. When the system >is subsequently rebooted in a proper way, the clean flag is set to 1, and, >voila, the filesystems are marked as clean for the next boot but they can >contain errors. The system should not allow mounting a dirty filesystem writable. > Correcting this problem is trivial: when a filesystem is mounted in >read-write mode, store the value of the clean flag and restore this value in >the superblock when the filesystem is unmounted. See above. > Also, I have compared the clean flag implementation with my own >implementation in the Linux Ext2 filesystem and I found that FreeBSD does >not allow the administrator to request periodical checks of the filesystems. This is by design. Nothing stops you from booting the machine single user and running fsck. > Of course, both the mount counter and the check interval can be >disabled to obtain the same behavior as the FreeBSD's current one. It wasn't obvious to me how to do this in the current structure of things without a kludge, so I decided that the feature wasn't important enough to bother. > I think that it would be worth implementing these features in FreeBSD. >I even think that I can come with a patch if people are interested but I'd like >to have your opinion before starting working on it. If the change is clean, I'd be happy to commit it; I'm really not interested in kludges in this area, however. A clean way to do this wasn't obvious to me at the time (it would have required changes to the superblock definition, for instance). -DG