fsck: Fix a reversion in direct mode fsck of a file that is present when the location log thinks it is not. Reversion introduced in version 5.20151208.

This commit is contained in:
Joey Hess 2016-07-12 13:41:03 -04:00
parent ff2f6ed241
commit 5642daa651
Failed to extract signature
4 changed files with 27 additions and 2 deletions

View file

@ -12,6 +12,9 @@ git-annex (6.20160614) UNRELEASED; urgency=medium
* Remove the EKG build flag, since Gentoo for some reason decided to
enable this flag, depsite it not being intended for production use and
so disabled by default.
* fsck: Fix a reversion in direct mode fsck of a file that is
present when the location log thinks it is not. Reversion introduced
in version 5.20151208.
-- Joey Hess <id@joeyh.name> Mon, 13 Jun 2016 21:52:24 -0400

View file

@ -214,11 +214,11 @@ fixLink key file = do
- in this repository only. -}
verifyLocationLog :: Key -> KeyStatus -> String -> Annex Bool
verifyLocationLog key keystatus desc = do
direct <- isDirect
obj <- calcRepo $ gitAnnexLocation key
present <- if isKeyUnlocked keystatus
present <- if not direct && isKeyUnlocked keystatus
then liftIO (doesFileExist obj)
else inAnnex key
direct <- isDirect
u <- getUUID
{- Since we're checking that a key's object file is present, throw

View file

@ -31,3 +31,5 @@ As for how such files happen in the first place, I've no idea myself. (For what
### What version of git-annex are you using? On what operating system?
Arch's community/git-annex 6.20160511
> [[fixed|done]] --[[Joey]]

View file

@ -0,0 +1,20 @@
[[!comment format=mdwn
username="joey"
subject="""comment 1"""
date="2016-07-12T17:29:55Z"
content="""
Bug sumitter, it would be good if you could find a way to reproduce
the location log getting out of sync with reality. While `git annex fsck`
is there to fix such a diverenge, it should not happen in the first place
in normal operation.
Reproduced by using `setpresentkey` to make the log not think
the file content is locally available. The file was available, and had
the right content, but fsck complains as shown.
Ok, found the bug, it was treating the file as an unlocked file,
but that meant it looked for the object file. That's the wrong
thing to do in direct mode. This reversion was introduced in
[[!commit e7183d83d367bb52f502266b11b5b6dff683279e]], so versions
before 5.20151208 were ok. Fixing..
"""]]