Skip to content

fix(fuse): check for the existence of op_header #1785

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

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

Conversation

cagatay-y
Copy link
Contributor

If the request fails, the host does not write an op_header and code that assumes its exitence fails. To prevent this, only assume the existence of the out_header and check its error field before continuing with the rest of the response. Fixes #1775.

I am marking the PR as draft as it contains commits from the open PR #1730.

@cagatay-y
Copy link
Contributor Author

It may also make sense to revert most of #1337, and remove the existing checks for the error code in other places as they are redundant.

@cagatay-y cagatay-y force-pushed the fuse-err branch 2 times, most recently from 6951e2c to 5fb09bd Compare June 25, 2025 16:57
@cagatay-y cagatay-y marked this pull request as ready for review June 25, 2025 17:13
@mkroening mkroening self-requested a review June 25, 2025 17:18
@mkroening mkroening self-assigned this Jun 25, 2025
Copy link
Member

@mkroening mkroening left a comment

Choose a reason for hiding this comment

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

Thanks! A few comments. :)

@cagatay-y cagatay-y force-pushed the fuse-err branch 2 times, most recently from 8c90730 to 82b12ed Compare June 26, 2025 22:18
If the request fails, the host does not write an op_header and code that assumes its exitence fails. To prevent this, only assume the existence of the out_header and check its error field before continuing with the rest of the response. Fixes hermit-os#1775.
@cagatay-y cagatay-y force-pushed the fuse-err branch 2 times, most recently from 1d52a1c to c9a386b Compare June 26, 2025 22:44
As the send_command function is now aware of the possibility of
op_header to not exist and returns an Err accordingly, we no longer need
to pretend Lookup commands do not result in a response with a sized
struct.
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.

Panics on virtiofs host errors
2 participants