]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
fsck_ffs: fix the previous change that skipped pass 5 in some cases
authorChuck Silvers <chs@FreeBSD.org>
Wed, 3 May 2023 20:21:19 +0000 (13:21 -0700)
committerChuck Silvers <chs@FreeBSD.org>
Wed, 3 May 2023 20:31:32 +0000 (13:31 -0700)
commit406475581246360faa7af9891dc8ad2423284e18
treee9c1d0db44870573dcb998451b21d31f5c7bd89e
parent9f27341c336aa12f6c7163c17e646e76c813b689
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
sbin/fsck_ffs/fsck.h
sbin/fsck_ffs/fsutil.c
sbin/fsck_ffs/gjournal.c
sbin/fsck_ffs/inode.c
sbin/fsck_ffs/main.c
sbin/fsck_ffs/pass1.c
sbin/fsck_ffs/suj.c