Additional diagnostic output when running fsck_ffs with debugging flag (-d)

MFC after:    1 week
Sponsored by: The FreeBSD Foundation
This commit is contained in:
Kirk McKusick 2022-10-30 14:59:44 -07:00
parent e85414931a
commit 595746df6f

View file

@ -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;