git-annex/Database
Joey Hess e4b2a067e0
fix potential race in updating inode cache
In Annex.Content, the object file was statted after pointer files were
populated. But if annex.thin is set, once the pointer files are
populated, the object file can potentially be modified via the hard
link. So, it was possible, though seemingly very unlikely, for the inode
of the modified object file to be cached.

Command.Fix and Command.Fsck had similar problems, statting the work
tree files after they were in place. Changed them to stat the temp file
that gets moved into place. This does rely on .git/annex being on the
same filesystem. If it's not, the cached inode will not be the same as
the one that the temp file gets moved to. Result will be that git-annex
will later need to do an expensive verification of the content of the
worktree files. Note that the cross-filesystem move of the temp file
already is a larger amount of extra work, so this seems acceptable.

Sponsored-by: Luke Shumaker on Patreon
2021-07-27 12:29:10 -04:00
..
Keys avoid double work in git-annex init, second try 2021-06-08 09:36:53 -04:00
Benchmark.hs more RawFilePath conversion 2020-11-05 18:45:37 -04:00
ContentIdentifier.hs remove ContentIndentifiersCidRemoteIndex uniqueness constraint 2020-12-23 14:03:33 -04:00
Export.hs use GIT keys for export of non-annexed files 2021-03-05 14:12:11 -04:00
Fsck.hs speed up keys database writes 2021-05-31 15:01:00 -04:00
Handle.hs Fix build with persistent-2.12.0.1 2021-04-01 12:21:02 -04:00
Init.hs more RawFilePath conversion 2020-11-05 18:45:37 -04:00
Keys.hs fix potential race in updating inode cache 2021-07-27 12:29:10 -04:00
Queue.hs more RawFilePath conversion 2020-11-05 18:45:37 -04:00
Types.hs started converting Ref from String to ByteString 2020-04-06 17:14:49 -04:00