vfs: fix race condition detected by serve ftp tests

This commit is contained in:
Nick Craig-Wood
2018-09-17 08:50:34 +01:00
parent d4ee7277c0
commit ef3526b3b8
+2
View File
@@ -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 {