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

mount: Some error handling fixups #959

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

cgwalters
Copy link
Collaborator

Motivated by #957 but probably not any kind of fix in reality. Our error handling here was buggy. What we really should do is avoid fork() and do an execve here, but that's a larger refactor.

  • Close the other side of the socket in the forked child so the parent doesn't hang indefinitely if the child dies before sending
  • Change the parent to return a clean error if the child doesn't write anything instead of an assert!
  • Check the exit code of the child

Motivated by containers#957
but probably not any kind of fix in reality. Our error handling here
was buggy. What we really should do is avoid `fork()` and do
an execve here, but that's a larger refactor.

- Close the other side of the socket in the forked child so
  the parent doesn't hang indefinitely if the child dies
  before sending
- Change the parent to return a clean error if the child
  doesn't write anything instead of an `assert!`
- Check the exit code of the child

Signed-off-by: Colin Walters <[email protected]>
@cgwalters cgwalters merged commit 785acc9 into containers:main Dec 11, 2024
25 checks passed
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