diff options
author | Ian Gudger <igudger@google.com> | 2019-06-28 20:06:33 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2019-06-28 20:07:52 -0700 |
commit | 45566fa4e4bc55e870ae1d7f80778be8432bdef5 (patch) | |
tree | 9b9064ef22a6f34ade4714cc90ad0573440c3e1c /pkg/sentry/fs/dirent.go | |
parent | 7dae043fecc109d7a0ae1d5d6274e48b1bf04d13 (diff) |
Add finalizer on AtomicRefCount to check for leaks.
PiperOrigin-RevId: 255711454
Diffstat (limited to 'pkg/sentry/fs/dirent.go')
-rw-r--r-- | pkg/sentry/fs/dirent.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pkg/sentry/fs/dirent.go b/pkg/sentry/fs/dirent.go index 28651e58b..fbca06761 100644 --- a/pkg/sentry/fs/dirent.go +++ b/pkg/sentry/fs/dirent.go @@ -229,11 +229,13 @@ func newDirent(inode *Inode, name string) *Dirent { if inode != nil { inode.MountSource.IncDirentRefs() } - return &Dirent{ + d := Dirent{ Inode: inode, name: name, children: make(map[string]*refs.WeakRef), } + d.EnableLeakCheck("fs.Dirent") + return &d } // NewNegativeDirent returns a new root negative Dirent. Otherwise same as NewDirent. |