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

(cherry picked from commit 20123b25ee51e9b122676a30d45c21a506bf1461)

Details