Skip to content

uefi: Change file reading to read in 1 MiB chunks #834

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

Merged
merged 1 commit into from
May 31, 2023

Conversation

nicholasbishop
Copy link
Member

Some UEFI implementations have a bug where large reads will incorrectly return an error, so read in 1 MiB chunks to avoid that.

Fixes #825

Checklist

  • Sensible git history (for example, squash "typo" or "fix" commits). See the Rewriting History guide for help.
  • Update the changelog (if necessary)

@nicholasbishop nicholasbishop marked this pull request as draft May 30, 2023 04:05
@nicholasbishop

This comment was marked as outdated.

@nicholasbishop nicholasbishop force-pushed the bishop-chunked-read-1 branch from 2177f1f to 4609adb Compare May 30, 2023 23:38
Some UEFI implementations have a bug where large reads will incorrectly return
an error, so read in 1 MiB chunks to avoid that.

The `RegularFile::read` method no longer returns `Option<usize>` in error data,
since that is only useful with directory reads. Directory reads continue to use
the original unchunked read, which is fine since directory entries should be
much smaller than the chunk size.

Fixes rust-osdev#825
@nicholasbishop nicholasbishop force-pushed the bishop-chunked-read-1 branch from 4609adb to 9464dce Compare May 30, 2023 23:48
@nicholasbishop nicholasbishop marked this pull request as ready for review May 30, 2023 23:48
@phip1611 phip1611 merged commit c38bb1a into rust-osdev:main May 31, 2023
@nicholasbishop nicholasbishop deleted the bishop-chunked-read-1 branch May 31, 2023 15:00
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.

Some UEFI implementations don't handle large file reads correctly
2 participants