mount: remove files that may still are open
related to https://github.com/chrislusf/seaweedfs/issues/1581
This commit is contained in:
@@ -364,6 +364,12 @@ func (dir *Dir) removeOneFile(req *fuse.RemoveRequest) error {
|
|||||||
dir.wfs.metaCache.DeleteEntry(context.Background(), filePath)
|
dir.wfs.metaCache.DeleteEntry(context.Background(), filePath)
|
||||||
dir.wfs.fsNodeCache.DeleteFsNode(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
|
// delete the chunks last
|
||||||
if isDeleteData {
|
if isDeleteData {
|
||||||
dir.wfs.deleteFileChunks(entry.Chunks)
|
dir.wfs.deleteFileChunks(entry.Chunks)
|
||||||
|
|||||||
Reference in New Issue
Block a user