Browse Source

mount: remove files that may still are open

related to https://github.com/chrislusf/seaweedfs/issues/1581
pull/1596/head
Chris Lu 4 years ago
parent
commit
4609644658
  1. 6
      weed/filesys/dir.go

6
weed/filesys/dir.go

@ -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…
Cancel
Save