FUSE: skip flushing if file is deleted

related to https://github.com/chrislusf/seaweedfs/issues/2110
This commit is contained in:
Chris Lu
2021-06-15 12:45:20 -07:00
parent cd59573dd3
commit 055374a50b
2 changed files with 11 additions and 2 deletions

View File

@@ -443,7 +443,10 @@ func (dir *Dir) removeOneFile(req *fuse.RemoveRequest) error {
dir.wfs.handlesLock.Lock()
defer dir.wfs.handlesLock.Unlock()
inodeId := filePath.AsInode()
delete(dir.wfs.handles, inodeId)
if fh, ok := dir.wfs.handles[inodeId]; ok {
delete(dir.wfs.handles, inodeId)
fh.isDeleted = true
}
return nil