mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
mount: remove files that may still are open
related to https://github.com/chrislusf/seaweedfs/issues/1581
This commit is contained in:
parent
df8d976bb0
commit
4609644658
|
@ -364,6 +364,12 @@ func (dir *Dir) removeOneFile(req *fuse.RemoveRequest) error {
|
|||
dir.wfs.metaCache.DeleteEntry(context.Background(), filePath)
|
||||
dir.wfs.fsNodeCache.DeleteFsNode(filePath)
|
||||
|
||||
// remove current file handle if any
|
||||
dir.wfs.handlesLock.Lock()
|
||||
defer dir.wfs.handlesLock.Unlock()
|
||||
inodeId := util.NewFullPath(dir.FullPath(), req.Name).AsInode()
|
||||
delete(dir.wfs.handles, inodeId)
|
||||
|
||||
// delete the chunks last
|
||||
if isDeleteData {
|
||||
dir.wfs.deleteFileChunks(entry.Chunks)
|
||||
|
|
Loading…
Reference in a new issue