Skip to content

Conversation

@Ayush1325
Copy link
Contributor

Tested using OVMF on QEMU.

@rustbot label +O-UEFI

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jan 9, 2026
@rustbot
Copy link
Collaborator

rustbot commented Jan 9, 2026

r? @ibraheemdev

rustbot has assigned @ibraheemdev.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer


let r = unsafe { ((*file_ptr).read)(file_ptr, &mut buf_size, buf.as_mut_ptr().cast()) };

if r.is_error() {
Copy link
Member

Choose a reason for hiding this comment

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

I think this should be

Suggested change
if r.is_error() {
if buf_size != 0 && r.is_error() {

since io::Read requires that

If an error is returned then it must be guaranteed that no bytes were read.

Copy link
Contributor Author

@Ayush1325 Ayush1325 Jan 9, 2026

Choose a reason for hiding this comment

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

Shouldn't this be if buf_size == 0 && r.is_error(). I think you want to guard against partial reads right?

Copy link
Member

Choose a reason for hiding this comment

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

Oh, yes, indeed.

@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 9, 2026
@rustbot
Copy link
Collaborator

rustbot commented Jan 9, 2026

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@rustbot rustbot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jan 9, 2026
@Ayush1325
Copy link
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 9, 2026
Tested using OVMF on QEMU.

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
@joboet
Copy link
Member

joboet commented Jan 9, 2026

@bors r+

@rust-bors rust-bors bot added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jan 9, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 9, 2026

📌 Commit fd59b32 has been approved by joboet

It is now in the queue for this repository.

@rust-bors rust-bors bot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 9, 2026
rust-bors bot added a commit that referenced this pull request Jan 10, 2026
Rollup of 9 pull requests

Successful merges:

 - #149318 (Implement partial_sort_unstable for slice)
 - #150805 (Fix ICE in inline always warning emission.)
 - #150822 (Fix for ICE: eii: fn / macro rules None in find_attr())
 - #150853 (std: sys: fs: uefi: Implement File::read)
 - #150855 (std: sys: fs: uefi: Implement File::tell)
 - #150881 (Fix std::fs::copy on WASI by setting proper OpenOptions flags)
 - #150891 (Fix a trivial typo in def_id.rs)
 - #150892 (Don't check `[mentions]` paths in submodules from tidy)
 - #150894 (cg_llvm: add a pause to make comment less confusing)

r? @ghost
@rust-bors rust-bors bot merged commit 93f6171 into rust-lang:main Jan 10, 2026
11 checks passed
@rustbot rustbot added this to the 1.94.0 milestone Jan 10, 2026
rust-timer added a commit that referenced this pull request Jan 10, 2026
Rollup merge of #150853 - uefi-fs-read, r=joboet

std: sys: fs: uefi: Implement File::read

Tested using OVMF on QEMU.

@rustbot label +O-UEFI
@Ayush1325 Ayush1325 deleted the uefi-fs-read branch January 10, 2026 05:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-UEFI UEFI S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants