Fix data loss that can occur when annex.pidlock is set in a repository.
This commit is contained in:
parent
2f48c0aa7c
commit
3e91cd13ba
3 changed files with 20 additions and 2 deletions
|
@ -47,8 +47,14 @@ tryLockExclusive :: Maybe FileMode -> LockFile -> Annex (Maybe LockHandle)
|
||||||
tryLockExclusive m f = tryPidLock m f $ Posix.tryLockExclusive m f
|
tryLockExclusive m f = tryPidLock m f $ Posix.tryLockExclusive m f
|
||||||
|
|
||||||
checkLocked :: LockFile -> Annex (Maybe Bool)
|
checkLocked :: LockFile -> Annex (Maybe Bool)
|
||||||
checkLocked f = Posix.checkLocked f
|
checkLocked f = Posix.checkLocked f `pidLockCheck` checkpid
|
||||||
`pidLockCheck` Pid.checkLocked
|
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 :: LockFile -> Annex LockStatus
|
||||||
getLockStatus f = Posix.getLockStatus f
|
getLockStatus f = Posix.getLockStatus f
|
||||||
|
|
1
debian/changelog
vendored
1
debian/changelog
vendored
|
@ -1,6 +1,7 @@
|
||||||
git-annex (6.20160230) UNRELEASED; urgency=medium
|
git-annex (6.20160230) UNRELEASED; urgency=medium
|
||||||
|
|
||||||
* metadata: Added -r to remove all current values of a field.
|
* 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 <id@joeyh.name> Mon, 29 Feb 2016 13:00:30 -0400
|
-- Joey Hess <id@joeyh.name> Mon, 29 Feb 2016 13:00:30 -0400
|
||||||
|
|
||||||
|
|
|
@ -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.
|
||||||
|
"""]]
|
Loading…
Reference in a new issue