From hsu@clinet.fi  Sat Nov 11 01:20:36 1995
Received: from hauki.clinet.fi (root@hauki.clinet.fi [194.100.0.1])
          by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id BAA09246
          for <FreeBSD-gnats-submit@freebsd.org>; Sat, 11 Nov 1995 01:20:32 -0800
Received: from katiska.clinet.fi (root@katiska.clinet.fi [194.100.0.4]) by hauki.clinet.fi (8.6.12/8.6.4) with ESMTP id LAA01202 for <FreeBSD-gnats-submit@freebsd.org>; Sat, 11 Nov 1995 11:20:25 +0200
Received: (hsu@localhost) by katiska.clinet.fi (8.6.12/8.6.4) id LAA08775; Sat, 11 Nov 1995 11:20:33 +0200
Message-Id: <199511110920.LAA08775@katiska.clinet.fi>
Date: Sat, 11 Nov 1995 11:20:33 +0200
From: Heikki Suonsivu <hsu@clinet.fi>
Reply-To: hsu@clinet.fi
To: FreeBSD-gnats-submit@freebsd.org
Subject: fsck -y ignores clean flag
X-Send-Pr-Version: 3.2

>Number:         816
>Category:       bin
>Synopsis:       fsck -y ignores clean flag
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Nov 11 01:30:01 PST 1995
>Closed-Date:    Sat Nov 11 05:17:30 PST 1995
>Last-Modified:  Sat Nov 11 05:18:36 PST 1995
>Originator:     Heikki Suonsivu
>Release:        FreeBSD 2.1.0-950928-SNAP i386
>Organization:
Clinet, Espoo, Finland
>Environment:

	A news server, with news disk mounted with -o async and
	fsck -y in /etc/rc before other fsck's to clean up the mess
	after a panic.

>Description:

	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.

>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.

>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?)

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: davidg 
State-Changed-When: Sat Nov 11 05:17:30 PST 1995 
State-Changed-Why:  
It's intentional that the clean bit is only consulted when "preening". The 
proper solution to this is to simply specify -p -y. 
>Unformatted:
