Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

vfs: fix race condition detected by serve ftp tests

Nick Craig-Woodef3526b3b8d8
diff --git a/vfs/file.go b/vfs/file.go
index fa2c7ac95..c4134d067 100644
--- a/vfs/file.go
+++ b/vfs/file.go
@@ -441,6 +441,8 @@ func (f *File) Sync() error {
// Remove the file
func (f *File) Remove() error {
+ f.mu.Lock()
+ defer f.mu.Unlock()
f.muRW.Lock()
defer f.muRW.Unlock()
if f.d.vfs.Opt.ReadOnly {