HomeFreeBSD

fsck_ffs(8): fix divide by zero when debug messages are enabled

Description

fsck_ffs(8): fix divide by zero when debug messages are enabled

Only print buffer cache debug message when a cache lookup has been done.

When running fsck_ffs -d on a gjournal'ed filesystem, it's possible
that totalreads is greater than zero when no cache lookup has been
done - causing a divide by zero. This commit fixes the following error:

Floating point exception (core dumped)

Reviewed by: mckusick
Differential Revision: https://reviews.freebsd.org/D30370

Details

Provenance
rewAuthored on May 20 2021, 8:53 PM
Reviewer
mckusick
Differential Revision
D30370: fsck_ffs(8): fix divide by zero when debug messages are enabled
Parents
rGcf74b2be533f: vfs: retire the now unused vnlru_free routine
Branches
Unknown
Tags
Unknown