From f3719fe2694d33cb60d92170656bd144b5498c50 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sat, 15 Jun 2019 10:42:53 +0100 Subject: [PATCH] fs/cache: unlock mutex in cache.Get to allow recursive calls This fixes the test lockup in the union tests --- fs/cache/cache.go | 2 ++ 1 file changed, 2 insertions(+) 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 }