HomeFreeBSD

fsck_ffs: fix the previous change that skipped pass 5 in some cases

Description

fsck_ffs: fix the previous change that skipped pass 5 in some cases

The previous change involved calling check_cgmagic() twice in a row
for the same CG in order to differentiate when the CG was already ok vs.
when the CG was rebuilt, but that doesn't work because the second call
(which was supposed to rebuild the CG) returns 0 (indicating that
the CG was not rebuilt) due to the prevfailcg check causing an early
failure return. Fix this by moving the rebuild part of check_cgmagic()
out into a separate function which is called by pass1() when it wants to
rebuild a CG.

Fixes: da86e7a20dc4a4b17e8d9e7630ed9b675cf71702
Reported by: pho
Discussed with: mckusick
Sponsored by: Netflix

(cherry picked from commit 406475581246360faa7af9891dc8ad2423284e18)

Details

Provenance
chsAuthored on May 3 2023, 8:21 PM
Parents
rG3f39a2a83945: ntpd: Support IPv6-only hosts
Branches
Unknown
Tags
Unknown