diff --git a/Annex/LockPool/PosixOrPid.hs b/Annex/LockPool/PosixOrPid.hs index ecf96d51fb..74ac3f1781 100644 --- a/Annex/LockPool/PosixOrPid.hs +++ b/Annex/LockPool/PosixOrPid.hs @@ -47,8 +47,14 @@ tryLockExclusive :: Maybe FileMode -> LockFile -> Annex (Maybe LockHandle) tryLockExclusive m f = tryPidLock m f $ Posix.tryLockExclusive m f checkLocked :: LockFile -> Annex (Maybe Bool) -checkLocked f = Posix.checkLocked f - `pidLockCheck` Pid.checkLocked +checkLocked f = Posix.checkLocked f `pidLockCheck` checkpid + where + checkpid pidlock = do + v <- Pid.checkLocked pidlock + case v of + -- Only return true when the posix lock file exists. + Just _ -> Posix.checkLocked f + Nothing -> return Nothing getLockStatus :: LockFile -> Annex LockStatus getLockStatus f = Posix.getLockStatus f diff --git a/debian/changelog b/debian/changelog index 721c5b3aa3..f49c1281e7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ git-annex (6.20160230) UNRELEASED; urgency=medium * metadata: Added -r to remove all current values of a field. + * Fix data loss that can occur when annex.pidlock is set in a repository. -- Joey Hess Mon, 29 Feb 2016 13:00:30 -0400 diff --git a/doc/bugs/thread_blocked_indefinitely_in_an_STM_transaction__while_moving_within__a_local_clone/comment_2_aa8c82f27965df44e69fd06b34be0ece._comment b/doc/bugs/thread_blocked_indefinitely_in_an_STM_transaction__while_moving_within__a_local_clone/comment_2_aa8c82f27965df44e69fd06b34be0ece._comment new file mode 100644 index 0000000000..2c06811d8a --- /dev/null +++ b/doc/bugs/thread_blocked_indefinitely_in_an_STM_transaction__while_moving_within__a_local_clone/comment_2_aa8c82f27965df44e69fd06b34be0ece._comment @@ -0,0 +1,11 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 2""" + date="2016-03-01T16:11:37Z" + content=""" +A worse problem with annex.pidlock is that it completly broke checking +whether a key is present in the repository. That could lead to data loss +when eg, moving --to a repo with annex.pidlock set. + +I've fixed that related bug. +"""]]