From plosher@isc.org  Tue Jun 10 01:30:42 2003
Return-Path: <plosher@isc.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id DA09237B401
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 10 Jun 2003 01:30:42 -0700 (PDT)
Received: from sf1.isc.org (sf1.isc.org [204.152.184.237])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 7ECEE43F93
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 10 Jun 2003 01:30:42 -0700 (PDT)
	(envelope-from plosher@isc.org)
Received: by sf1.isc.org (Postfix, from userid 10188)
	id 08DBA2841F; Tue, 10 Jun 2003 08:30:42 +0000 (UTC)
Message-Id: <20030610083042.08DBA2841F@sf1.isc.org>
Date: Tue, 10 Jun 2003 08:30:42 +0000 (UTC)
From: Peter Losher <plosher@isc.org>
Reply-To: Peter Losher <plosher@isc.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: background fscking causing ffs_valloc panic.
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         53137
>Category:       kern
>Synopsis:       [ffs] [panic] background fscking causing ffs_valloc panic.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    jh
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jun 10 01:40:14 PDT 2003
>Closed-Date:    Fri Aug 20 03:49:45 UTC 2010
>Last-Modified:  Tue Apr 12 23:50:03 UTC 2011
>Originator:     Peter Losher
>Release:        FreeBSD 5.1-RELEASE i386
>Organization:
ISC
>Environment:
System: FreeBSD sf1.isc.org 5.1-RELEASE FreeBSD 5.1-RELEASE #0: Mon Jun 9 01:34:57 UTC 2003 root@:/usr/src/sys/i386/compile/ISC_FBSD_51_SMP i386

	
>Description:

Because of a kernel panic, this system was unable to cleanly dismount its 
local drives.  On the subequent reboot the system marked the large (230GB) data 
partition (/dev/twed0s1g = /hog) for background fscking:

-=-
Starting file system checks:
/dev/twed0s1a: UNREF FILE I=8365  OWNER=root MODE=100600
/dev/twed0s1a: SIZE=344064 MTIME=Jun  9 19:58 2003  (CLEARED)
/dev/twed0s1a: FREE BLK COUNT(S) WRONG IN SUPERBLK (SALVAGED)
/dev/twed0s1a: SUMMARY INFORMATION BAD (SALVAGED)
/dev/twed0s1a: BLK(S) MISSING IN BIT MAPS (SALVAGED)
/dev/twed0s1a: 1264 files, 47473 used, 81446 free (190 frags, 10157 blocks, 0.1%
fragmentation)
/dev/twed0s1g: DEFER FOR BACKGROUND CHECKING
/dev/twed0s1d: DEFER FOR BACKGROUND CHECKING
/dev/twed0s1e: DEFER FOR BACKGROUND CHECKING

/dev/twed0s1f: UNREF FILE I=2619949  OWNER=news MODE=100644
/dev/twed0s1f: SIZE=134523 MTIME=Jun  9 02:00 2003  (CLEARED)
/dev/twed0s1f: FREE BLK COUNT(S) WRONG IN SUPERBLK (SALVAGED)
/dev/twed0s1f: SUMMARY INFORMATION BAD (SALVAGED)
/dev/twed0s1f: BLK(S) MISSING IN BIT MAPS (SALVAGED)
/dev/twed0s1f: 844287 files, 3452688 used, 21113556 free (259396 frags, 2606770
blocks, 1.1% fragmentation)
WARNING: /hog was not properly dismounted
/hog: mount pending error: blocks 12816 files 5
/hog: superblock summary recomputed
WARNING: /usr was not properly dismounted
WARNING: /var was not properly dismounted
/var: superblock summary recomputed
-=-

After starting the background fsck'ing it panics:

-=-
Starting background file system checks.

Mon Jun  9 21:00:29 UTC 2003
mode = 041777, inum = 4, fs = /hog
panic: ffs_valloc: dup alloc
cpuid = 0; lapic.id = 00000000
boot() called on cpu#0
-=-

>How-To-Repeat:

No reliable way to reproduce the problem; perhaps do a big write on a large 
partition, cut the power (thus not properly sync'ing the disks) and try a 
background fsck upon reboot.

>Fix:

You either have to go into single-user mode and manually fsck the partition,
or turn off background fscking in /etc/rc.conf (background_fsck="NO").
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-i386->freebsd-bugs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Fri Sep 3 02:33:37 GMT 2004 
Responsible-Changed-Why:  
This does not sound i386-specific. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=53137 
Responsible-Changed-From-To: freebsd-bugs->freebsd-fs 
Responsible-Changed-By: brucec 
Responsible-Changed-When: Sat Apr 3 10:59:39 UTC 2010 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=53137 
State-Changed-From-To: open->feedback 
State-Changed-By: jh 
State-Changed-When: Fri Jul 16 10:59:27 UTC 2010 
State-Changed-Why:  
Is this still a problem for you? 


Responsible-Changed-From-To: freebsd-fs->jh 
Responsible-Changed-By: jh 
Responsible-Changed-When: Fri Jul 16 10:59:27 UTC 2010 
Responsible-Changed-Why:  
Track. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=53137 
State-Changed-From-To: feedback->closed 
State-Changed-By: jh 
State-Changed-When: Fri Aug 20 03:49:44 UTC 2010 
State-Changed-Why:  
Feedback timeout. 

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

From: Arnaud Lacombe <lacombar@gmail.com>
To: bug-followup@FreeBSD.org, plosher@isc.org
Cc:  
Subject: Re: kern/53137: [ffs] [panic] background fscking causing ffs_valloc panic.
Date: Tue, 12 Apr 2011 19:20:08 -0400

 Just seen such panic on a 7.1 kernel. It was fixed by running
 `fsck_ffs -y' manually on the dirty partition from a 9-CURRENT
 machine.
>Unformatted:
