vfs: fix writeback deadlocks and other bugs

- fix deadlock when cancelling upload
- fix double upload and panic after cancelled upload
- fix cancelation strategy of uploading files
    - don't cancel uploads if we don't modify the file
    - cancel uploads if we do modify the file
- fix deadlock between Item and writeback
- fix confusion about whether writeback item was being uploaded
- fix cornercases in cancelling uploads and removing files
This commit is contained in:
Nick Craig-Wood
2020-06-15 15:09:33 +01:00
parent 279a516c53
commit fa472a340e
4 changed files with 93 additions and 31 deletions

View File

@@ -558,6 +558,7 @@ func (f *File) Remove() (err error) {
if wasWriting {
// Ignore error deleting file if was writing it as it may not be uploaded yet
err = nil
fs.Debugf(f._path(), "Ignoring File.Remove file error as uploading: %v", err)
} else {
fs.Debugf(f._path(), "File.Remove file error: %v", err)
}