Avoid the --fast option preventing checksumming in some cases it was not supposed to

fsck --fast was intended to disable checksumming, but checksumming is done
after transfers too. Due to the check being in the non-incremental path,
it would only affect non-incremental checksumming during a transfer,
and I'm not 100% sure that it was a problem.

Also, when using an external backend that does checksumming, fsck --fast
didn't disable it and now does.
This commit is contained in:
Joey Hess 2024-05-12 21:36:48 -04:00
parent 8844372c23
commit 0281f7f23e
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
2 changed files with 14 additions and 8 deletions

View file

@ -2,6 +2,8 @@ git-annex (10.20240431) UNRELEASED; urgency=medium
* fsck: Fix recent reversion that made it say it was checksumming files
whose content is not present.
* Avoid the --fast option preventing checksumming in some cases it
was not supposed to.
* Typo fixes.
Thanks, Yaroslav Halchenko

View file

@ -528,14 +528,18 @@ checkBackendRemote key remote ai localcopy =
checkBackendOr (badContentRemote remote localcopy) key localcopy ai
checkBackendOr :: (Key -> Annex String) -> Key -> RawFilePath -> ActionItem -> Annex Bool
checkBackendOr bad key file ai = do
ok <- verifyKeyContent' key file
unless ok $ do
msg <- bad key
warning $ actionItemDesc ai
<> ": Bad file content; "
<> UnquotedString msg
return ok
checkBackendOr bad key file ai =
ifM (Annex.getRead Annex.fast)
( return True
, do
ok <- verifyKeyContent' key file
unless ok $ do
msg <- bad key
warning $ actionItemDesc ai
<> ": Bad file content; "
<> UnquotedString msg
return ok
)
{- Check, if there are InodeCaches recorded for a key, that one of them
- matches the object file. There are situations where the InodeCache