Bug 816 - fsck -y ignores clean flag
Summary: fsck -y ignores clean flag
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 1995-11-11 09:30 UTC by Heikki Suonsivu
Modified: 1995-11-11 13:18 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Heikki Suonsivu 1995-11-11 09:30:01 UTC
	fsck -y causes clean bit to be ignored.  This is nasty as fsck
	-y is necessary with -o async, and getting a full news feed needs
	-o async.  But currently it takes forever to reboot the news server
	because it will do a forced check on the news spool.

Fix: 

I think this ...

	if (preen && sblock.fs_clean && !fflag) {
		pwarn("clean, %ld free ", sblock.fs_cstotal.cs_nffree +
			sblock.fs_frag * sblock.fs_cstotal.cs_nbfree);
		printf("(%ld frags, %ld blocks, %.1f%% fragmentation)\n",

... should be changed into 

	if (sblock.fs_clean && !fflag) {
		pwarn("clean, %ld free ", sblock.fs_cstotal.cs_nffree +
			sblock.fs_frag * sblock.fs_cstotal.cs_nbfree);
		printf("(%ld frags, %ld blocks, %.1f%% fragmentation)\n",

ie. always check the clean flag unless -f has been specified.

I don't know if there is any change a disk could look clean even if it
has been modified, if there are they need to be fixed first (writing
the clean flag off on first access?)
How-To-Repeat: 
	reboot a system cleanly, but boot into single user, and do an fsck
	for a clean disk with -y.  It will do a forced check on the disk.
Comment 1 davidg freebsd_committer freebsd_triage 1995-11-11 13:17:30 UTC
State Changed
From-To: open->closed

It's intentional that the clean bit is only consulted when "preening". The 
proper solution to this is to simply specify -p -y.