Skip to content

Commit 55bbd63

Browse files
author
gaoanke
committed
Fix ReadDir inode leak
1 parent 350ff31 commit 55bbd63

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

internal/goofys.go

+10
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,16 @@ func (fs *Goofys) ForgetInode(
764764
fs.mu.Lock()
765765
defer fs.mu.Unlock()
766766

767+
if inode.isDir() {
768+
for _, child := range inode.dir.Children {
769+
if *child.Name == "." || *child.Name == ".." {
770+
continue
771+
}
772+
delete(fs.inodes, child.Id)
773+
fs.forgotCnt += 1
774+
}
775+
}
776+
767777
delete(fs.inodes, op.Inode)
768778
fs.forgotCnt += 1
769779

0 commit comments

Comments
 (0)