refresh cached file entry from sync metadata updates

This commit is contained in:
Chris Lu
2020-10-25 09:42:47 -07:00
parent 46cb692d83
commit 10a4a628e9
3 changed files with 9 additions and 5 deletions

View File

@@ -119,10 +119,12 @@ func (wfs *WFS) AcquireHandle(file *File, uid, gid uint32) (fileHandle *FileHand
defer wfs.handlesLock.Unlock()
inodeId := file.fullpath().AsInode()
existingHandle, found := wfs.handles[inodeId]
if found && existingHandle != nil {
file.isOpen++
return existingHandle
if file.isOpen > 0 {
existingHandle, found := wfs.handles[inodeId]
if found && existingHandle != nil {
file.isOpen++
return existingHandle
}
}
fileHandle = newFileHandle(file, uid, gid)