storeExportWithContentIdentifierM for directory special remote
Not sure if my reasoning about the races really holds. It would certianly be possible to better guard against races by using Linux-specific renameat2 with RENAME_EXCHANGE or RENAME_NOREPLACE. Or by using link and relying on it not overwriting existing files -- but that would need a filesystem that supports hard links and directory can be used in filesystems that don't.
This commit is contained in:
parent
1ec9e1494c
commit
88ccfaa78c
2 changed files with 49 additions and 4 deletions
|
@ -274,9 +274,8 @@ data ImportActions a = ImportActions
|
|||
--
|
||||
-- Since other things can modify the same file on the special
|
||||
-- remote, this must take care to not overwrite such modifications,
|
||||
-- and only overwrite a file that has the same ContentIdentifier
|
||||
-- as was passed to it, unless listContents can recover an
|
||||
-- overwritten file.
|
||||
-- and only overwrite a file that has one of the ContentIdentifiers
|
||||
-- passed to it, unless listContents can recover an overwritten file.
|
||||
--
|
||||
-- Also, since there can be concurrent writers, the implementation
|
||||
-- needs to make sure that the ContentIdentifier it returns
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue