summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-07-12 13:41:03 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-07-12 13:41:03 -0400
commit6eaf1e333399625f48f03fb504811a397ab9e0cc (patch)
tree57e057d1d4e68f6d487da6cc911e098b83462551
parent51774936cd87be4f95aa7c3256066654f1e23e90 (diff)
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.
-rw-r--r--CHANGELOG3
-rw-r--r--Command/Fsck.hs4
-rw-r--r--doc/bugs/fsck__44___no_known_copies.mdwn2
-rw-r--r--doc/bugs/fsck__44___no_known_copies/comment_1_e13b4e3b9f1c836fe4ca69bcac2b8afb._comment20
4 files changed, 27 insertions, 2 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 71358f7f8..c7f6c4d35 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 <id@joeyh.name> Mon, 13 Jun 2016 21:52:24 -0400
diff --git a/Command/Fsck.hs b/Command/Fsck.hs
index 28ce7752d..6bc91f0ef 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 8d97be3ac..589910167 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 000000000..012c70637
--- /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..
+"""]]