-
Notifications
You must be signed in to change notification settings - Fork 378
linux: handle openat error #1920
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
Conversation
Fail early to make the code easier to read. Signed-off-by: Erik Sjölund <[email protected]>
Reviewer's guide (collapsed on small PRs)Reviewer's GuideRefactors error handling around openat failure in make_parent_mount_private to fail early with a clearer, more precise error while preserving the original errno. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there - I've reviewed your changes - here's some feedback:
- This change alters behavior by treating an
openatfailure as fatal even when the subsequentfaccessatsucceeds; if the intent is only to fail when the directory is inaccessible, consider whether you still want to allow execution to continue whenfaccessatpasses butopenatfails for another reason (e.g.,ENFILE,EMFILE). - Consider declaring
saved_errnoasconst intto document that it is not modified after capturingerrnoand to make the intent slightly clearer.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- This change alters behavior by treating an `openat` failure as fatal even when the subsequent `faccessat` succeeds; if the intent is only to fail when the directory is inaccessible, consider whether you still want to allow execution to continue when `faccessat` passes but `openat` fails for another reason (e.g., `ENFILE`, `EMFILE`).
- Consider declaring `saved_errno` as `const int` to document that it is not modified after capturing `errno` and to make the intent slightly clearer.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
TMT tests failed. @containers/packit-build please check. |
giuseppe
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fail early to make the code easier to read.
What do you think? Does it make sense?
Summary by Sourcery
Bug Fixes: