vfs: fix race condition detected by serve ftp tests
This commit is contained in:
parent
d4ee7277c0
commit
ef3526b3b8
1 changed files with 2 additions and 0 deletions
|
@ -441,6 +441,8 @@ func (f *File) Sync() error {
|
||||||
|
|
||||||
// Remove the file
|
// Remove the file
|
||||||
func (f *File) Remove() error {
|
func (f *File) Remove() error {
|
||||||
|
f.mu.Lock()
|
||||||
|
defer f.mu.Unlock()
|
||||||
f.muRW.Lock()
|
f.muRW.Lock()
|
||||||
defer f.muRW.Unlock()
|
defer f.muRW.Unlock()
|
||||||
if f.d.vfs.Opt.ReadOnly {
|
if f.d.vfs.Opt.ReadOnly {
|
||||||
|
|
Loading…
Reference in a new issue