1
0
mirror of https://github.com/rclone/rclone.git synced 2026-01-06 02:23:24 +00:00

vfs: fix rename of open files when using the VFS cache

Before this change, renaming an open file when using the VFS cache was
delayed until the file was closed.  This meant that the file was not
readable after a rename even though it is was in the cache.

After this change we rename the local cache file and the in memory
cache, delaying only the rename of the file in object storage.

See: https://forum.rclone.org/t/xen-orchestra-ebadf-bad-file-descriptor-write/13104
This commit is contained in:
Nick Craig-Wood
2019-12-05 12:58:24 +00:00
parent 241921c786
commit 6e683b4359
3 changed files with 146 additions and 32 deletions

View File

@@ -698,7 +698,7 @@ func TestRWFileModTimeWithOpenWriters(t *testing.T) {
}
}
func TestCacheRename(t *testing.T) {
func TestRWCacheRename(t *testing.T) {
r := fstest.NewRun(t)
defer r.Finalise()