summaryrefslogtreecommitdiffhomepage
path: root/pkg/refsvfs2/refs_map.go
diff options
context:
space:
mode:
authorDean Deng <deandeng@google.com>2020-10-28 19:00:01 -0700
committergVisor bot <gvisor-bot@google.com>2020-10-28 19:02:02 -0700
commit265f1eb2c7abbbf924448ef6bbd8cddb13e66b9f (patch)
treead863e1f94d8c21edcb7ee3fe1d5b429c5a5962b /pkg/refsvfs2/refs_map.go
parent3b4674ffe0e6ef1b016333ee726293ecf70c4e4e (diff)
Add leak checking for kernfs.Dentry.
Updates #1486. PiperOrigin-RevId: 339581879
Diffstat (limited to 'pkg/refsvfs2/refs_map.go')
-rw-r--r--pkg/refsvfs2/refs_map.go14
1 files changed, 0 insertions, 14 deletions
diff --git a/pkg/refsvfs2/refs_map.go b/pkg/refsvfs2/refs_map.go
index 57938d2f0..faf191f39 100644
--- a/pkg/refsvfs2/refs_map.go
+++ b/pkg/refsvfs2/refs_map.go
@@ -16,16 +16,12 @@ package refsvfs2
import (
"fmt"
- "strings"
"gvisor.dev/gvisor/pkg/log"
refs_vfs1 "gvisor.dev/gvisor/pkg/refs"
"gvisor.dev/gvisor/pkg/sync"
)
-// TODO(gvisor.dev/issue/1193): re-enable once kernfs refs are fixed.
-var ignored []string = []string{"kernfs.", "proc.", "sys.", "devpts.", "fuse."}
-
var (
// liveObjects is a global map of reference-counted objects. Objects are
// inserted when leak check is enabled, and they are removed when they are
@@ -60,11 +56,6 @@ func leakCheckEnabled() bool {
// Register adds obj to the live object map.
func Register(obj CheckedObject) {
if leakCheckEnabled() {
- for _, str := range ignored {
- if strings.Contains(obj.RefType(), str) {
- return
- }
- }
liveObjectsMu.Lock()
if _, ok := liveObjects[obj]; ok {
panic(fmt.Sprintf("Unexpected entry in leak checking map: reference %p already added", obj))
@@ -81,11 +72,6 @@ func Unregister(obj CheckedObject) {
liveObjectsMu.Lock()
defer liveObjectsMu.Unlock()
if _, ok := liveObjects[obj]; !ok {
- for _, str := range ignored {
- if strings.Contains(obj.RefType(), str) {
- return
- }
- }
panic(fmt.Sprintf("Expected to find entry in leak checking map for reference %p", obj))
}
delete(liveObjects, obj)