summaryrefslogtreecommitdiffstats
path: root/sbin/fsck_ffs/pass5.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2008-10-13 14:01:05 +0000
committerkib <kib@FreeBSD.org>2008-10-13 14:01:05 +0000
commit042990e0410fe3c6471eb9fcd91a863a780423d9 (patch)
treeef1bd698d6d05ce4ce43a62a41322ec380c93d71 /sbin/fsck_ffs/pass5.c
parent352dfe0f0ab8b5992412b69d07c5fdffe9d6c626 (diff)
downloadFreeBSD-src-042990e0410fe3c6471eb9fcd91a863a780423d9.zip
FreeBSD-src-042990e0410fe3c6471eb9fcd91a863a780423d9.tar.gz
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
Diffstat (limited to 'sbin/fsck_ffs/pass5.c')
-rw-r--r--sbin/fsck_ffs/pass5.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/sbin/fsck_ffs/pass5.c b/sbin/fsck_ffs/pass5.c
index f585e92..173156e 100644
--- a/sbin/fsck_ffs/pass5.c
+++ b/sbin/fsck_ffs/pass5.c
@@ -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 &&
OpenPOWER on IntegriCloud