Subject: bin/1209: no 'timeout' on file system cleanliness
To: None <gnats-admin@sun-lamp.pc.cs.cmu.edu>
From: Chris G. Demetriou <cgd@NetBSD.ORG>
List: netbsd-bugs
Date: 07/11/1995 22:20:29
>Number:         1209
>Category:       bin
>Synopsis:       There should be a time/mount limit after which fs's are cleaned
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Tue Jul 11 22:20:23 1995
>Originator:     Chris G. Demetriou
>Organization:
Kernel Hackers 'r' Us
>Release:        7/11/95 NetBSD-current
>Environment:
System: NetBSD sun-lamp.pc.cs.cmu.edu 1.0A NetBSD 1.0A (SUN_LAMP) #2: Fri Jun 30 05:16:58 EDT 1995 cgd@sun-lamp.pc.cs.cmu.edu:/usr/src/sys/arch/i386/compile/SUN_LAMP i386


>Description:
	Most systems which provide 'file system clean' flags also provide
	a way to insure that 'fsck' cleans the file systems periodically --
	either after a certain number of mounts/unmounts, or after a
	certain period of time -- in order to help protect agains bit rot,
	cosmic rays, etc.

	NetBSD has no such mechanism.

>How-To-Repeat:
	Mount and unmount clean a file system repeatedly, over a long period
	of time.

	Note that as long as the file system is clean, it will never be checked
	by 'fsck -p' (or, now, by 'fsck').

>Fix:
	Add fields to the superblock indicating either: "last fsck" and
	"time between fscks," or "mounts until fsck" and "default mounts
	until fsck," depending on whether a "check by date" or a "check
	by number of times mounted" method was desired.

	if the former method:
		have fsck set the date of last fsck when fscking the file
		system, and have it fsck the file system, even if clean,
		if the file system hasn't been fsck'd in the specified
		amount of time.

	if the latter method:
		have the kernel decrement the "mounts until fsck" field
		before setting the clean flag un unmount.  have fsck
		check the field on reboot, and check the file system
		if it's zero (regardless of the clean flag's setting).
		When fsck updates the superblock (and marks the FS clean),
		have it reset the count to the 'default' value.
>Audit-Trail:
>Unformatted: