Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes: internal representation of cgroups hierarchical structure #2586

Merged
merged 1 commit into from
Mar 1, 2025

Conversation

dschervov
Copy link
Contributor

What do i want:

I want to fix bug in function "find_dir()". Then CRIU add cgroups it search
parent directory for cgroup to add it in the correct place. But function
that check it - "strstartswith()" is incorrent in this context. For example:

New cgroup: /dsch_tasks
Existent cgroup: /dsch

The "strstartswith" will return TRUE (which is ok) but in our context
/dsch is not parent directory for /dsch_tasks.

Thats why i cannot restore my application. So i want to fix this bug:
"(00.002162) Error (criu/cgroup.c:1766): cg: failed to open cg dir fd
(freezer//dsch/tasks) for chowning: Not a directory"

How i want to do it:

I replace "strstartswith()" on to "issubpath()" function.
It is written exactly for this purpose.

Signed-off-by: Dmitrii Chervov [email protected]

@dschervov
Copy link
Contributor Author

dschervov commented Feb 10, 2025

CC: @0x7f454c46 , @avagin

Can you please check my PR.

@dschervov
Copy link
Contributor Author

gentle ping : - )

CC: @0x7f454c46 , @avagin

Can you please check my 1 line PR.

@avagin
Copy link
Member

avagin commented Feb 28, 2025

@dschervov Please revise the commit message to align with our contributing guidelines. See
https://github.com/checkpoint-restore/criu/blob/criu-dev/CONTRIBUTING.md#describe-your-changes for details.

strstartswith() function is incorrect choice for finding parent
directory so i change it to issubpath() function

Signed-off-by: Dmitrii Chervov <[email protected]>
@dschervov
Copy link
Contributor Author

@dschervov Please revise the commit message to align with our contributing guidelines. See https://github.com/checkpoint-restore/criu/blob/criu-dev/CONTRIBUTING.md#describe-your-changes for details.

Yes, thank you for information! My bad : - ( I rename my commit message

@avagin avagin merged commit e71d53c into checkpoint-restore:criu-dev Mar 1, 2025
9 of 10 checks passed
@avagin
Copy link
Member

avagin commented Mar 1, 2025

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants