cgroup2fs: DecRef inodes returned by Lookup for consistency - #14576
Merged
Conversation
copybara-service
Bot
force-pushed
the
test/cl975402262
branch
from
September 4, 2026 23:37
a68a679 to
6b8b599
Compare
OrderedChildren.Lookup returns the inode with a ref that the caller is expected to release (normally by handing it to a dentry via Init). Five cgroup2fs call sites that look an inode up for a transient purpose (permission checks, control-file read/write, interface-file removal) never released that ref. This is NOT a bug fix: every inode these sites can return (cgroupInterfaceFile and eventFile, both via kernfs.DynamicBytesFile, and cgroup directories themselves) embeds kernfs.InodeNoopRefCount, so IncRef/DecRef are no-ops and nothing leaks today. The change only makes the ref discipline explicit and correct, so these sites stay safe if a lookup ever returns a genuinely refcounted inode. PiperOrigin-RevId: 976563179
copybara-service
Bot
force-pushed
the
test/cl975402262
branch
from
September 5, 2026 00:16
6b8b599 to
42d8c41
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
cgroup2fs: DecRef inodes returned by Lookup for consistency
OrderedChildren.Lookup returns the inode with a ref that the caller is
expected to release (normally by handing it to a dentry via Init). Five
cgroup2fs call sites that look an inode up for a transient purpose
(permission checks, control-file read/write, interface-file removal)
never released that ref.
This is NOT a bug fix: every inode these sites can return
(cgroupInterfaceFile and eventFile, both via kernfs.DynamicBytesFile,
and cgroup directories themselves) embeds kernfs.InodeNoopRefCount, so
IncRef/DecRef are no-ops and nothing leaks today. The change only makes
the ref discipline explicit and correct, so these sites stay safe if a
lookup ever returns a genuinely refcounted inode.