diff options
Diffstat (limited to 'weed/filesys/wfs.go')
| -rw-r--r-- | weed/filesys/wfs.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/weed/filesys/wfs.go b/weed/filesys/wfs.go index f6a6031d2..54eb9064b 100644 --- a/weed/filesys/wfs.go +++ b/weed/filesys/wfs.go @@ -187,15 +187,15 @@ func (wfs *WFS) Fsync(file *File, header fuse.Header) error { existingHandle, found := wfs.handles[inodeId] wfs.handlesLock.Unlock() - if found && existingHandle != nil && existingHandle.f.isOpen > 0 { - - existingHandle.Add(1) - defer existingHandle.Done() + if found && existingHandle != nil { existingHandle.Lock() defer existingHandle.Unlock() - return existingHandle.doFlush(context.Background(), header) + if existingHandle.f.isOpen > 0 { + return existingHandle.doFlush(context.Background(), header) + } + } return nil |
