rclone/vfs
Nick Craig-Wood f980f230c5 vfs: fix virtual entries causing deleted files to still appear
Before this change, if a file was created on a remote but deleted
externally from that remote then there was potential for the delete to
never be noticed.

The sequence of events was:

- Create file on VFS - creates virtual directory entry
- File deleted externally to remote before the directory refreshed
- Now the file has a virtual add but is not in the listings so will never disappear

This patch fixes it by removing all virtual directory entries except
the following when the directory is re-read.

- On remotes which can't have empty directories: virtual directory
  adds are not flushed. These will remain virtual as long as the
  directory is empty.

- For virtual file add: files that are in the process of being
  uploaded are not flushed

This patch also adds the distinction between virtually added files and
directories.

It also refactors the virtual directory logic to make it easier to follow.

Fixes #4446
2020-11-10 16:47:25 +00:00
..
test_vfs lib/random: unify random string generation into random.String 2019-08-06 12:44:08 +01:00
vfscache accounting: add context.Context #3257 #4685 2020-11-09 18:05:54 +00:00
vfscommon docs: spelling: e.g. 2020-10-28 18:16:23 +00:00
vfsflags vfs: add --vfs-read-ahead parameter for use with --vfs-cache-mode full 2020-08-06 17:26:18 +01:00
vfstest Spelling fixes 2020-10-14 15:21:31 +01:00
dir_handle_test.go vfs: add --vfs-writeback option to delay writes back to cloud storage 2020-06-30 12:01:36 +01:00
dir_handle.go Spelling fixes 2020-10-14 15:21:31 +01:00
dir_test.go vfs: fix virtual entries causing deleted files to still appear 2020-11-10 16:47:25 +00:00
dir.go vfs: fix virtual entries causing deleted files to still appear 2020-11-10 16:47:25 +00:00
errors_test.go vfs: add tests and subsequent fixes 2017-11-04 10:24:10 +00:00
errors.go build: drop support for go1.8 2019-04-15 21:49:58 +01:00
file_test.go test: Add context to mockfs.NewFs #3257 #4685 2020-11-09 18:05:54 +00:00
file.go vfs: fix virtual entries causing deleted files to still appear 2020-11-10 16:47:25 +00:00
help.go Spelling fixes 2020-10-14 15:21:31 +01:00
make_open_tests.go vfs: bring DO NOT EDIT comments in line with "go help generate" 2020-04-30 12:24:44 +01:00
open_test.go vfs: bring DO NOT EDIT comments in line with "go help generate" 2020-04-30 12:24:44 +01:00
rc_test.go vfs: fix vfs/refresh calls with fs= parameter 2020-11-07 14:26:33 +00:00
rc.go vfs: fix vfs/refresh calls with fs= parameter 2020-11-07 14:26:33 +00:00
read_test.go vfs: add --vfs-writeback option to delay writes back to cloud storage 2020-06-30 12:01:36 +01:00
read_write_test.go vfs: Make tests run reliably 2020-06-30 12:01:36 +01:00
read_write.go Spelling fixes 2020-10-14 15:21:31 +01:00
read.go accounting: add context.Context #3257 #4685 2020-11-09 18:05:54 +00:00
vfs_case_test.go vfs: add --vfs-writeback option to delay writes back to cloud storage 2020-06-30 12:01:36 +01:00
vfs_test.go Spelling fixes 2020-10-14 15:21:31 +01:00
vfs.go docs: spelling: e.g. 2020-10-28 18:16:23 +00:00
vfstest_test.go mount: change interface of mount commands to take mount options 2020-07-24 10:48:51 +01:00
vstate_string.go vfs: fix virtual entries causing deleted files to still appear 2020-11-10 16:47:25 +00:00
write_test.go vfs: add --vfs-writeback option to delay writes back to cloud storage 2020-06-30 12:01:36 +01:00
write.go docs: spelling: etc. 2020-10-28 18:16:23 +00:00