From owner-svn-src-head@FreeBSD.ORG Mon Oct 13 14:01:06 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37B491065686; Mon, 13 Oct 2008 14:01:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 262D28FC38; Mon, 13 Oct 2008 14:01:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9DE16Hb077878; Mon, 13 Oct 2008 14:01:06 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9DE16LW077877; Mon, 13 Oct 2008 14:01:06 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200810131401.m9DE16LW077877@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 13 Oct 2008 14:01:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r183821 - head/sbin/fsck_ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Oct 2008 14:01:06 -0000 Author: kib Date: Mon Oct 13 14:01:05 2008 New Revision: 183821 URL: http://svn.freebsd.org/changeset/base/183821 Log: Background fsck applies twice some summary totals changes. The next background fsck on the same file system might then print negative numbers for reclaimed directories/files/fragments. Address the issue in a limited degree, by using old summary data for cg when bgfsck is performed. Submitted by: tegge MFC after: 1 week Modified: head/sbin/fsck_ffs/pass5.c Modified: head/sbin/fsck_ffs/pass5.c ============================================================================== --- head/sbin/fsck_ffs/pass5.c Mon Oct 13 13:56:23 2008 (r183820) +++ head/sbin/fsck_ffs/pass5.c Mon Oct 13 14:01:05 2008 (r183821) @@ -291,10 +291,17 @@ pass5(void) sump[run]++; } } - cstotal.cs_nffree += newcg->cg_cs.cs_nffree; - cstotal.cs_nbfree += newcg->cg_cs.cs_nbfree; - cstotal.cs_nifree += newcg->cg_cs.cs_nifree; - cstotal.cs_ndir += newcg->cg_cs.cs_ndir; + if (bkgrdflag != 0) { + cstotal.cs_nffree += cg->cg_cs.cs_nffree; + cstotal.cs_nbfree += cg->cg_cs.cs_nbfree; + cstotal.cs_nifree += cg->cg_cs.cs_nifree; + cstotal.cs_ndir += cg->cg_cs.cs_ndir; + } else { + cstotal.cs_nffree += newcg->cg_cs.cs_nffree; + cstotal.cs_nbfree += newcg->cg_cs.cs_nbfree; + cstotal.cs_nifree += newcg->cg_cs.cs_nifree; + cstotal.cs_ndir += newcg->cg_cs.cs_ndir; + } cs = &fs->fs_cs(fs, c); if (cursnapshot == 0 && memcmp(&newcg->cg_cs, cs, sizeof *cs) != 0 &&