From 5642daa65174fa04a8a218bc5ab4807f0648a6d2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 12 Jul 2016 13:41:03 -0400 Subject: [PATCH] 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. --- CHANGELOG | 3 +++ Command/Fsck.hs | 4 ++-- doc/bugs/fsck__44___no_known_copies.mdwn | 2 ++ ..._e13b4e3b9f1c836fe4ca69bcac2b8afb._comment | 20 +++++++++++++++++++ 4 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 doc/bugs/fsck__44___no_known_copies/comment_1_e13b4e3b9f1c836fe4ca69bcac2b8afb._comment diff --git a/CHANGELOG b/CHANGELOG index 71358f7f8e..c7f6c4d359 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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 Mon, 13 Jun 2016 21:52:24 -0400 diff --git a/Command/Fsck.hs b/Command/Fsck.hs index 28ce7752d9..6bc91f0ef6 100644 --- a/Command/Fsck.hs +++ b/Command/Fsck.hs @@ -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 diff --git a/doc/bugs/fsck__44___no_known_copies.mdwn b/doc/bugs/fsck__44___no_known_copies.mdwn index 8d97be3ac0..589910167c 100644 --- a/doc/bugs/fsck__44___no_known_copies.mdwn +++ b/doc/bugs/fsck__44___no_known_copies.mdwn @@ -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]] diff --git a/doc/bugs/fsck__44___no_known_copies/comment_1_e13b4e3b9f1c836fe4ca69bcac2b8afb._comment b/doc/bugs/fsck__44___no_known_copies/comment_1_e13b4e3b9f1c836fe4ca69bcac2b8afb._comment new file mode 100644 index 0000000000..012c706374 --- /dev/null +++ b/doc/bugs/fsck__44___no_known_copies/comment_1_e13b4e3b9f1c836fe4ca69bcac2b8afb._comment @@ -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.. +"""]]