Skip to content

Commit

Permalink
Fix ReadDir inode leak
Browse files Browse the repository at this point in the history
  • Loading branch information
gaoanke committed Feb 20, 2024
1 parent 350ff31 commit 55bbd63
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions internal/goofys.go
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,16 @@ func (fs *Goofys) ForgetInode(
fs.mu.Lock()
defer fs.mu.Unlock()

if inode.isDir() {
for _, child := range inode.dir.Children {
if *child.Name == "." || *child.Name == ".." {
continue
}
delete(fs.inodes, child.Id)
fs.forgotCnt += 1
}
}

delete(fs.inodes, op.Inode)
fs.forgotCnt += 1

Expand Down

0 comments on commit 55bbd63

Please sign in to comment.