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 {