Copy with a reflink when exporting a tree to a directory special remote

Remote.Directory makes a temp file, then calls this, and since the temp
file exists, it prevented probing if CoW works.

Note that deleting the empty file does mean there's a small window for a
race. If another process is also exporting to the remote, that could let it
make the same temp file. However, the temp filename actually has the
processes's pid in it, which avoids that being a problem.

This may have been a reversion caused by commits around
63d508e885, but I haven't gone back and
tested to be sure. The directory special remote had supposedly supported
CoW for this going back to about half a year before that.

Sponsored-by: Graham Spencer on Patreon
This commit is contained in:
Joey Hess 2023-03-28 13:06:11 -04:00
parent d2d7d766d8
commit a5709dcc22
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
3 changed files with 22 additions and 5 deletions

View file

@ -40,3 +40,5 @@ After running, a `btrfs filesystem du ...` tells me that the `repo` and `import`
---
In general: Thank you so much for this wonderful piece of software, I'm using it for years now and manage virtually everything with it (audio, video, pictures, important documents, papers, …).
> [[fixed|done]] --[[Joey]]