Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Oct 2008 14:01:06 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r183821 - head/sbin/fsck_ffs
Message-ID:  <200810131401.m9DE16LW077877@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 &&



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200810131401.m9DE16LW077877>