Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Mar 1995 08:20:55 -0800
From:      David Greenman <davidg@Root.COM>
To:        Remy.Card@masi.ibp.fr
Cc:        hackers@FreeBSD.org
Subject:   Re: Filesystem clean flag 
Message-ID:  <199503191621.IAA02117@corbin.Root.COM>
In-Reply-To: Your message of "Sun, 19 Mar 95 16:58:08 GMT." <199503191658.QAA00122@bbj.ibp.fr> 

next in thread | previous in thread | raw e-mail | index | archive | help
>	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



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