From be9c7c21ecc0450244e4e02648c0ac5ba49f458a Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Tue, 2 Mar 2021 11:17:17 -0800 Subject: [PATCH] reduce possibility of nil file entry --- weed/filesys/dir.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weed/filesys/dir.go b/weed/filesys/dir.go index 10a0a2b44..ca826fbbc 100644 --- a/weed/filesys/dir.go +++ b/weed/filesys/dir.go @@ -389,12 +389,12 @@ func (dir *Dir) removeOneFile(req *fuse.RemoveRequest) error { // clear entry inside the file fsNode := dir.wfs.fsNodeCache.GetFsNode(filePath) + dir.wfs.fsNodeCache.DeleteFsNode(filePath) if fsNode != nil { if file, ok := fsNode.(*File); ok { file.clearEntry() } } - dir.wfs.fsNodeCache.DeleteFsNode(filePath) // remove current file handle if any dir.wfs.handlesLock.Lock()