avoid creating content directory when locking content
authorJoey Hess <joeyh@joeyh.name>
Mon, 16 May 2022 16:34:56 +0000 (12:34 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 16 May 2022 16:34:56 +0000 (12:34 -0400)
commit5a98f2d50913682c4ebe0e0c4ce695c450a96091
treeb9d3f332f9196e4797e2d37deb780e05ebb39d5b
parentb6c781980394556f571fed64b2004edb1228d4ec
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
Annex/Content.hs
Annex/Content/Presence.hs
Annex/Perms.hs
Command/Fix.hs
Command/Lock.hs
Upgrade/V5/Direct.hs
doc/todo/command_to___34__migrate__34___from_adjusted_mode/comment_6_e8ab74bb4951fe7f0c71630bb278ad6f._comment [new file with mode: 0644]