Skip to content

WIP: fix post-switch-root file operations #63

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jamuir
Copy link
Contributor

@jamuir jamuir commented Feb 19, 2025

Share the first part of the Cisco patch authored by Oleksiy Obitotskyy to fix reading from /proc/schedstat post-switch-root (see #60).

More changes are needed since writing the svg file fails.

Share the first part of the Cisco patch authored by Oleksiy Obitotskyy
to fix reading from /proc/schedstat post-switch-root (see systemd#60).

More changes are needed since writing the svg file fails.
@jamuir
Copy link
Contributor Author

jamuir commented Feb 19, 2025

@sofar : this is WIP, but please share any comments you might have.

There is some code duplication.

src/store.c Outdated
if (fd < 0)
return log_error_errno(errno, "Failed to openat /proc/<>: %m");

if (fstatat(procfd, fn, &st, 0) < 0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just use fstat(fd, ... here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done. that is simpler.

@sofar
Copy link
Contributor

sofar commented Feb 19, 2025

Please change the patch title to something other than "WIP 1". Looks okay in general, just some small remarks from me.

@jamuir
Copy link
Contributor Author

jamuir commented Feb 21, 2025

Please change the patch title to something other than "WIP 1". Looks okay in general, just some small remarks from me.

I will create a better commit message after I finish the next part (i.e. fixing the writing of the svg file). This is still a draft PR.

@sofar
Copy link
Contributor

sofar commented Feb 21, 2025

Just put WIP in the title of the PR. Nothing wrong with iterative development imho. Once you're ready for merging, I would squash together your commits into coherent changesets.

@jamuir jamuir changed the title fix post-switch-root file operations WIP: fix post-switch-root file operations Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants