systemd part 3: Cgroup2 partial stubbing#285
Open
arihant2math wants to merge 1 commit intohexagonal-sun:masterfrom
Open
systemd part 3: Cgroup2 partial stubbing#285arihant2math wants to merge 1 commit intohexagonal-sun:masterfrom
arihant2math wants to merge 1 commit intohexagonal-sun:masterfrom
Conversation
97818c0 to
7e3539f
Compare
7e3539f to
c2475d8
Compare
hexagonal-sun
requested changes
Apr 27, 2026
| } | ||
|
|
||
| if cgroupfs().has_live_processes_direct(&child) { | ||
| return Err(FsError::DirectoryNotEmpty.into()); |
Owner
There was a problem hiding this comment.
I think according to the man page this should be EBUSY.
| fn alloc_inode_id(&self) -> InodeId { | ||
| InodeId::from_fsid_and_inodeid( | ||
| CGROUPFS_ID, | ||
| self.next_inode_id.fetch_add(1, Ordering::SeqCst), |
Owner
There was a problem hiding this comment.
You can get away with Relaxed ordering here.
| #[async_trait] | ||
| impl Inode for CgroupDirInode { | ||
| fn id(&self) -> InodeId { | ||
| self.id |
Owner
There was a problem hiding this comment.
Returning the raw unshifted value here will eventually collide with your control inode IDs returned in file_inode_id. Maybe in alloc_inode_id you could increment in the stride of your shift:
fn alloc_inode_id(&self) -> InodeId {
InodeId::from_fsid_and_inodeid(
CGROUPFS_ID,
// Or whatever shift you choose.
self.next_inode_id.fetch_add(16, Ordering::Relaxed),
)
}
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.
This pull request adds support for the
/proc/[pid]/cgroupfile and integrates basic cgroup registration and unregistration for thread groups. It also changes the mount syscall to improve filesystem type handling.