-
Notifications
You must be signed in to change notification settings - Fork 20
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
fix: Truncated fat entries on error #44
base: master
Are you sure you want to change the base?
Conversation
Looks like this needs some test updates. |
read incomplete data in permissive mode
@ideeockus thank you for the help! |
@@ -299,12 +320,14 @@ fn read_data_from_stream<F: Read + Seek>( | |||
if stream_len < consts::MINI_STREAM_CUTOFF as u64 { | |||
let mut chain = minialloc.open_mini_chain(start_sector)?; | |||
chain.seek(SeekFrom::Start(buf_offset_from_start))?; | |||
chain.read_exact(&mut buf[..num_bytes])?; | |||
return Ok(read_until_error(&mut chain, &mut buf[..num_bytes]) |
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.
I'm a little confused what's going on with this change. Seems like it's changing to ignore IO errors? Why is that desired?
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.
@mdsteele fat entries may be incomplete. read_exact
emits Error { kind: UnexpectedEof, message: "failed to fill whole buffer" }
in case of incomplete data
Thanks, and sorry for the slow replies on my part. Could we add a unit test for this? It would be good to have. Also, I guess I'm concerned that this might not be the best way to solve the problem (I'm worried it will cover up other kinds of errors that it shouldn't), but having something to test against will make it easier to try out alternative solutions in the future. |
Closed: #41