diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-12-12 00:05:43 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-12-12 00:05:43 +0000 |
commit | 445e57ac75a4c48e5455fdaf5b3e963594c15346 (patch) | |
tree | c2794d96cddf521e40e74bc0d26d000133cf3139 /pkg/sentry/fsimpl/proc | |
parent | 0aa7d2a4b264764152ef79db960e920f2e101780 (diff) | |
parent | 1e92732eb19ac5cfa3df6ff01cc1ea71d80a9198 (diff) |
Merge release-20201208.0-36-g1e92732eb (automated)
Diffstat (limited to 'pkg/sentry/fsimpl/proc')
-rw-r--r-- | pkg/sentry/fsimpl/proc/fd_dir_inode_refs.go | 9 | ||||
-rw-r--r-- | pkg/sentry/fsimpl/proc/fd_info_dir_inode_refs.go | 9 | ||||
-rw-r--r-- | pkg/sentry/fsimpl/proc/subtasks_inode_refs.go | 9 | ||||
-rw-r--r-- | pkg/sentry/fsimpl/proc/task_inode_refs.go | 9 | ||||
-rw-r--r-- | pkg/sentry/fsimpl/proc/tasks_inode_refs.go | 9 |
5 files changed, 10 insertions, 35 deletions
diff --git a/pkg/sentry/fsimpl/proc/fd_dir_inode_refs.go b/pkg/sentry/fsimpl/proc/fd_dir_inode_refs.go index 4644809bd..390927c63 100644 --- a/pkg/sentry/fsimpl/proc/fd_dir_inode_refs.go +++ b/pkg/sentry/fsimpl/proc/fd_dir_inode_refs.go @@ -54,11 +54,6 @@ func (r *fdDirInodeRefs) LogRefs() bool { return fdDirInodeenableLogging } -// EnableLeakCheck enables reference leak checking on r. -func (r *fdDirInodeRefs) EnableLeakCheck() { - refsvfs2.Register(r) -} - // ReadRefs returns the current number of references. The returned count is // inherently racy and is unsafe to use without external synchronization. func (r *fdDirInodeRefs) ReadRefs() int64 { @@ -115,7 +110,7 @@ func (r *fdDirInodeRefs) TryIncRef() bool { func (r *fdDirInodeRefs) DecRef(destroy func()) { v := atomic.AddInt64(&r.refCount, -1) if fdDirInodeenableLogging { - refsvfs2.LogDecRef(r, v+1) + refsvfs2.LogDecRef(r, v) } switch { case v < 0: @@ -132,6 +127,6 @@ func (r *fdDirInodeRefs) DecRef(destroy func()) { func (r *fdDirInodeRefs) afterLoad() { if r.ReadRefs() > 0 { - r.EnableLeakCheck() + refsvfs2.Register(r) } } diff --git a/pkg/sentry/fsimpl/proc/fd_info_dir_inode_refs.go b/pkg/sentry/fsimpl/proc/fd_info_dir_inode_refs.go index dbc7e3f5a..5c44e617f 100644 --- a/pkg/sentry/fsimpl/proc/fd_info_dir_inode_refs.go +++ b/pkg/sentry/fsimpl/proc/fd_info_dir_inode_refs.go @@ -54,11 +54,6 @@ func (r *fdInfoDirInodeRefs) LogRefs() bool { return fdInfoDirInodeenableLogging } -// EnableLeakCheck enables reference leak checking on r. -func (r *fdInfoDirInodeRefs) EnableLeakCheck() { - refsvfs2.Register(r) -} - // ReadRefs returns the current number of references. The returned count is // inherently racy and is unsafe to use without external synchronization. func (r *fdInfoDirInodeRefs) ReadRefs() int64 { @@ -115,7 +110,7 @@ func (r *fdInfoDirInodeRefs) TryIncRef() bool { func (r *fdInfoDirInodeRefs) DecRef(destroy func()) { v := atomic.AddInt64(&r.refCount, -1) if fdInfoDirInodeenableLogging { - refsvfs2.LogDecRef(r, v+1) + refsvfs2.LogDecRef(r, v) } switch { case v < 0: @@ -132,6 +127,6 @@ func (r *fdInfoDirInodeRefs) DecRef(destroy func()) { func (r *fdInfoDirInodeRefs) afterLoad() { if r.ReadRefs() > 0 { - r.EnableLeakCheck() + refsvfs2.Register(r) } } diff --git a/pkg/sentry/fsimpl/proc/subtasks_inode_refs.go b/pkg/sentry/fsimpl/proc/subtasks_inode_refs.go index 993251646..4b655a383 100644 --- a/pkg/sentry/fsimpl/proc/subtasks_inode_refs.go +++ b/pkg/sentry/fsimpl/proc/subtasks_inode_refs.go @@ -54,11 +54,6 @@ func (r *subtasksInodeRefs) LogRefs() bool { return subtasksInodeenableLogging } -// EnableLeakCheck enables reference leak checking on r. -func (r *subtasksInodeRefs) EnableLeakCheck() { - refsvfs2.Register(r) -} - // ReadRefs returns the current number of references. The returned count is // inherently racy and is unsafe to use without external synchronization. func (r *subtasksInodeRefs) ReadRefs() int64 { @@ -115,7 +110,7 @@ func (r *subtasksInodeRefs) TryIncRef() bool { func (r *subtasksInodeRefs) DecRef(destroy func()) { v := atomic.AddInt64(&r.refCount, -1) if subtasksInodeenableLogging { - refsvfs2.LogDecRef(r, v+1) + refsvfs2.LogDecRef(r, v) } switch { case v < 0: @@ -132,6 +127,6 @@ func (r *subtasksInodeRefs) DecRef(destroy func()) { func (r *subtasksInodeRefs) afterLoad() { if r.ReadRefs() > 0 { - r.EnableLeakCheck() + refsvfs2.Register(r) } } diff --git a/pkg/sentry/fsimpl/proc/task_inode_refs.go b/pkg/sentry/fsimpl/proc/task_inode_refs.go index 632251e75..1bc355b12 100644 --- a/pkg/sentry/fsimpl/proc/task_inode_refs.go +++ b/pkg/sentry/fsimpl/proc/task_inode_refs.go @@ -54,11 +54,6 @@ func (r *taskInodeRefs) LogRefs() bool { return taskInodeenableLogging } -// EnableLeakCheck enables reference leak checking on r. -func (r *taskInodeRefs) EnableLeakCheck() { - refsvfs2.Register(r) -} - // ReadRefs returns the current number of references. The returned count is // inherently racy and is unsafe to use without external synchronization. func (r *taskInodeRefs) ReadRefs() int64 { @@ -115,7 +110,7 @@ func (r *taskInodeRefs) TryIncRef() bool { func (r *taskInodeRefs) DecRef(destroy func()) { v := atomic.AddInt64(&r.refCount, -1) if taskInodeenableLogging { - refsvfs2.LogDecRef(r, v+1) + refsvfs2.LogDecRef(r, v) } switch { case v < 0: @@ -132,6 +127,6 @@ func (r *taskInodeRefs) DecRef(destroy func()) { func (r *taskInodeRefs) afterLoad() { if r.ReadRefs() > 0 { - r.EnableLeakCheck() + refsvfs2.Register(r) } } diff --git a/pkg/sentry/fsimpl/proc/tasks_inode_refs.go b/pkg/sentry/fsimpl/proc/tasks_inode_refs.go index 0b2af4269..af0c4f025 100644 --- a/pkg/sentry/fsimpl/proc/tasks_inode_refs.go +++ b/pkg/sentry/fsimpl/proc/tasks_inode_refs.go @@ -54,11 +54,6 @@ func (r *tasksInodeRefs) LogRefs() bool { return tasksInodeenableLogging } -// EnableLeakCheck enables reference leak checking on r. -func (r *tasksInodeRefs) EnableLeakCheck() { - refsvfs2.Register(r) -} - // ReadRefs returns the current number of references. The returned count is // inherently racy and is unsafe to use without external synchronization. func (r *tasksInodeRefs) ReadRefs() int64 { @@ -115,7 +110,7 @@ func (r *tasksInodeRefs) TryIncRef() bool { func (r *tasksInodeRefs) DecRef(destroy func()) { v := atomic.AddInt64(&r.refCount, -1) if tasksInodeenableLogging { - refsvfs2.LogDecRef(r, v+1) + refsvfs2.LogDecRef(r, v) } switch { case v < 0: @@ -132,6 +127,6 @@ func (r *tasksInodeRefs) DecRef(destroy func()) { func (r *tasksInodeRefs) afterLoad() { if r.ReadRefs() > 0 { - r.EnableLeakCheck() + refsvfs2.Register(r) } } |