avoid creating content directory when locking content
If the content directory does not exist, then it does not make sense to lock the content file, as it also does not exist, and so it's ok for the lock operation to fail. This avoids potential races where the content file exists but is then deleted/renamed, while another process sees that it exists and goes to lock it, resulting in a dangling lock file in an otherwise empty object directory. Also renamed modifyContent to modifyContentDir since it is not only necessarily used for modifying content files, but also other files in the content directory. Sponsored-by: Dartmouth College's Datalad project
This commit is contained in:
parent
b6c7819803
commit
5a98f2d509
7 changed files with 52 additions and 16 deletions
|
@ -78,7 +78,7 @@ breakHardLink file key obj = do
|
|||
error "unable to break hard link"
|
||||
thawContent tmp'
|
||||
Database.Keys.storeInodeCaches key [tmp']
|
||||
modifyContent obj $ freezeContent obj
|
||||
modifyContentDir obj $ freezeContent obj
|
||||
next $ return True
|
||||
|
||||
makeHardLink :: RawFilePath -> Key -> CommandPerform
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue