1
0
Fork 0
mirror of https://github.com/chrislusf/seaweedfs synced 2024-07-03 23:56:41 +02:00

mount: clear possible leftover entry data in memory

This commit is contained in:
Chris Lu 2020-11-01 23:28:56 -08:00
parent 448475e100
commit e1423a83dd

View file

@ -362,6 +362,14 @@ func (dir *Dir) removeOneFile(req *fuse.RemoveRequest) error {
// then, delete meta cache and fsNode cache
dir.wfs.metaCache.DeleteEntry(context.Background(), filePath)
// clear entry inside the file
fsNode := dir.wfs.fsNodeCache.GetFsNode(filePath)
if fsNode != nil {
if file, ok := fsNode.(*File); ok {
file.clearEntry()
}
}
dir.wfs.fsNodeCache.DeleteFsNode(filePath)
// remove current file handle if any