aboutsummaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorKirk McKusick <mckusick@FreeBSD.org>2022-10-30 21:59:44 +0000
committerKirk McKusick <mckusick@FreeBSD.org>2022-10-30 22:00:20 +0000
commit595746df6fe946363233bd3eb73abe34e4457359 (patch)
tree0743d1ed3dd36c9641d526c8eedd0115dce159ee /sbin
parente85414931a374f5847d87cc88a90592541c17ff9 (diff)
downloadsrc-595746df6fe946363233bd3eb73abe34e4457359.tar.gz
src-595746df6fe946363233bd3eb73abe34e4457359.zip
Additional diagnostic output when running fsck_ffs with debugging flag (-d)
MFC after: 1 week Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'sbin')
-rw-r--r--sbin/fsck_ffs/pass5.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/sbin/fsck_ffs/pass5.c b/sbin/fsck_ffs/pass5.c
index 324e725929f6..61be54ed54ed 100644
--- a/sbin/fsck_ffs/pass5.c
+++ b/sbin/fsck_ffs/pass5.c
@@ -375,6 +375,22 @@ pass5(void)
if (cursnapshot == 0 &&
memcmp(&cstotal, &fs->fs_cstotal, sizeof cstotal) != 0
&& dofix(&idesc[0], "SUMMARY BLK COUNT(S) WRONG IN SUPERBLK")) {
+ if (debug) {
+ printf("cstotal is currently: %jd dirs, %jd blks free, "
+ "%jd frags free, %jd inos free, %jd clusters\n",
+ (intmax_t)fs->fs_cstotal.cs_ndir,
+ (intmax_t)fs->fs_cstotal.cs_nbfree,
+ (intmax_t)fs->fs_cstotal.cs_nffree,
+ (intmax_t)fs->fs_cstotal.cs_nifree,
+ (intmax_t)fs->fs_cstotal.cs_numclusters);
+ printf("cstotal ought to be: %jd dirs, %jd blks free, "
+ "%jd frags free, %jd inos free, %jd clusters\n",
+ (intmax_t)cstotal.cs_ndir,
+ (intmax_t)cstotal.cs_nbfree,
+ (intmax_t)cstotal.cs_nffree,
+ (intmax_t)cstotal.cs_nifree,
+ (intmax_t)cstotal.cs_numclusters);
+ }
memmove(&fs->fs_cstotal, &cstotal, sizeof cstotal);
fs->fs_ronly = 0;
fs->fs_fmod = 0;