mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
reduce possibility of nil file entry
This commit is contained in:
parent
02e146f3e1
commit
be9c7c21ec
|
@ -389,12 +389,12 @@ func (dir *Dir) removeOneFile(req *fuse.RemoveRequest) error {
|
||||||
|
|
||||||
// clear entry inside the file
|
// clear entry inside the file
|
||||||
fsNode := dir.wfs.fsNodeCache.GetFsNode(filePath)
|
fsNode := dir.wfs.fsNodeCache.GetFsNode(filePath)
|
||||||
|
dir.wfs.fsNodeCache.DeleteFsNode(filePath)
|
||||||
if fsNode != nil {
|
if fsNode != nil {
|
||||||
if file, ok := fsNode.(*File); ok {
|
if file, ok := fsNode.(*File); ok {
|
||||||
file.clearEntry()
|
file.clearEntry()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dir.wfs.fsNodeCache.DeleteFsNode(filePath)
|
|
||||||
|
|
||||||
// remove current file handle if any
|
// remove current file handle if any
|
||||||
dir.wfs.handlesLock.Lock()
|
dir.wfs.handlesLock.Lock()
|
||||||
|
|
Loading…
Reference in a new issue