use InodeCache to avoid races in import from directory special remote

This does not avoid all possible races, but it does avoid all likely
ones, and is demonstratably better than git's own handling of races
where files get modified at the same time as it's updating the working
tree.

The main thing this won't detect are not unlikely races where part
of a file gets changed while it's being copied and then the file is
restored to its original condition before the modification check.
No, it's more likely that the limitations of checking inode, size,
and mtime won't detect certian modifications, involving eg mmapped
files.
This commit is contained in:
Joey Hess 2019-03-04 13:20:58 -04:00
parent 51fc969b66
commit 3cd19fb4d0
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
3 changed files with 91 additions and 28 deletions

View file

@ -10,9 +10,6 @@ this.
## implementation notes
* directory special remote import is prototype, does not notice modified
files, not race safe
* Need to support annex-tracking-branch configuration, which documentation
says makes git-annex sync and assistant do imports.