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

fs/cache: unlock mutex in cache.Get to allow recursive calls

Nick Craig-Woodf3719fe2694d
diff --git a/fs/cache/cache.go b/fs/cache/cache.go
index ce331ca66..569209834 100644
--- a/fs/cache/cache.go
+++ b/fs/cache/cache.go
@@ -30,7 +30,9 @@ func Get(fsString string) (f fs.Fs, err error) {
defer fsCacheMu.Unlock()
entry, ok := fsCache[fsString]
if !ok {
+ fsCacheMu.Unlock() // Unlock in case Get is called recursively
f, err = fsNewFs(fsString)
+ fsCacheMu.Lock()
if err != nil && err != fs.ErrorIsFile {
return f, err
}