From khera@kcilink.com  Wed Sep 21 18:15:08 2005
Return-Path: <khera@kcilink.com>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 0293F16A41F
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 21 Sep 2005 18:15:08 +0000 (GMT)
	(envelope-from khera@kcilink.com)
Received: from yertle.kcilink.com (yertle.kcilink.com [65.205.34.180])
	by mx1.FreeBSD.org (Postfix) with ESMTP id AF33343D48
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 21 Sep 2005 18:15:07 +0000 (GMT)
	(envelope-from khera@kcilink.com)
Received: by yertle.kcilink.com (Postfix, from userid 1002)
	id 2A0E6B811; Wed, 21 Sep 2005 14:15:07 -0400 (EDT)
Message-Id: <20050921181507.2A0E6B811@yertle.kcilink.com>
Date: Wed, 21 Sep 2005 14:15:07 -0400 (EDT)
From: Vivek Khera <vivek@khera.org>
Reply-To: Vivek Khera <vivek@khera.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: backgroud fsck leaves incorrect free block count
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         86423
>Category:       kern
>Synopsis:       backgroud fsck leaves incorrect free block count
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    truckman
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Sep 21 18:20:04 GMT 2005
>Closed-Date:    Tue Jun 12 05:17:43 GMT 2007
>Last-Modified:  Tue Jun 12 05:17:43 GMT 2007
>Originator:     Vivek Khera
>Release:        FreeBSD 5.4-RELEASE-p1 amd64
>Organization:
>Environment:
System: FreeBSD yertle.int.kciLink.com 5.4-STABLE FreeBSD 5.4-STABLE #7: Tue May 31 11:38:22 EDT 2005 khera@yertle.int.kciLink.com:/usr/obj/usr/src/sys/YERTLE amd64


	
>Description:
	

I had a 5.4-RELEASE-p1 box lockup (not sure if hardware is at fault).
Background fsck ran when the system was reset, and all seems well.  However,
when I went to do an upgrade to 5.4-R-p7 and I ran fsck after kernel install,
boot into single user, before installworld.  Below is what I saw.  Basically,
the file systems are marked clean, but in reality some have incorrect free
block count.

# fsck -p
/dev/amrd0s1a: FILE SYSTEM CLEAN; SKIPPING CHECKS
/dev/amrd0s1a: clean, 112993 free (553 frags, 14055 blocks, 0.4% fragmentation)
/dev/amrd0s1d: FILE SYSTEM CLEAN; SKIPPING CHECKS
/dev/amrd0s1d: clean, 352825 free (5865 frags, 43370 blocks, 1.2% fragmentation)
/dev/amrd1s1d: FILE SYSTEM CLEAN; SKIPPING CHECKS
/dev/amrd1s1d: clean, 21768850 free (154 frags, 2721087 blocks, 0.0% fragmentation)
/dev/amrd0s1e: FILE SYSTEM CLEAN; SKIPPING CHECKS
/dev/amrd0s1e: clean, 8011569 free (2977 frags, 1001074 blocks, 0.0% fragmentation)
# fsck
** /dev/amrd0s1a
** Last Mounted on /
** Root file system
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
630 files, 13846 used, 112993 free (553 frags, 14055 blocks, 0.4% fragmentation)
** /dev/amrd0s1d
** Last Mounted on /usr
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
17901 files, 153662 used, 352825 free (5865 frags, 43370 blocks, 1.2% fragmentation)
** /dev/amrd0s1e
** Last Mounted on /var
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
SUMMARY BLK COUNT(S) WRONG IN SUPERBLK
SALVAGE? [yn] y

43033 files, 6672834 used, 8011567 free (2983 frags, 1001073 blocks, 0.0% fragmentation)

***** FILE SYSTEM WAS MODIFIED *****
** /dev/amrd1s1d
** Last Mounted on /u/d01
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
FREE BLK COUNT(S) WRONG IN SUPERBLK
SALVAGE? [yn] y

623 files, 31557828 used, 21768850 free (154 frags, 2721087 blocks, 0.0% fragmentation)

***** FILE SYSTEM WAS MODIFIED *****
# 


>How-To-Repeat:
	

pull the plug on an active file system.  reboot, let bg fsck run, then
go to single user mode and run fsck.

>Fix:

	

this is way beyond my capabilities.
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->truckman 
Responsible-Changed-By: pjd 
Responsible-Changed-When: Wed Oct 5 08:30:53 GMT 2005 
Responsible-Changed-Why:  
Don, could you look at this? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=86423 
State-Changed-From-To: open->feedback 
State-Changed-By: linimon 
State-Changed-When: Sun Mar 4 02:25:06 UTC 2007 
State-Changed-Why:  
Is this still a problem with current versions of FreeBSD? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=86423 

From: Vivek Khera <vivek@khera.org>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/86423: backgroud fsck leaves incorrect free block count
Date: Mon, 5 Mar 2007 10:21:03 -0500

 Can't say for sure if it is still a problem.  The box in question  
 doesn't crash anymore since I've been upgraded to 6.1+ and disabled  
 the onboard bge card in preference to an Intel em-based NIC card.
 
 If one of my other boxes crashes, I'll be sure to double check if  
 this happens.
 
State-Changed-From-To: feedback->closed 
State-Changed-By: linimon 
State-Changed-When: Tue Jun 12 05:11:56 UTC 2007 
State-Changed-Why:  
Vivek, 

since this hasn't happened in 2 months I'm going to go ahead and close it. 
If I'm incorrect or it happens again, we can reopen it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=86423 
>Unformatted:
