Skip to content

Conversation

@ikrivosheev
Copy link
Contributor

Closed: #41

@mdsteele
Copy link
Owner

Looks like this needs some test updates.

@ikrivosheev
Copy link
Contributor Author

@ideeockus thank you for the help!
@mdsteele could you review?)

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])
Copy link
Owner

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?

Copy link

@ideeockus ideeockus Sep 2, 2024

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

@mdsteele
Copy link
Owner

mdsteele commented Sep 6, 2024

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.

@sftse
Copy link
Contributor

sftse commented Oct 29, 2025

This is at least partially superseeded by #65 and #71. There are still cases that could lead to a mismatch in the FAT and the actual number of sectors, in which case we could simply truncate the FAT. The original issue #41 prompting this however seems to have been fixed.

@ikrivosheev
Copy link
Contributor Author

This is at least partially superseeded by #65 and #71. There are still cases that could lead to a mismatch in the FAT and the actual number of sectors, in which case we could simply truncate the FAT. The original issue #41 prompting this however seems to have been fixed.

Thank you! I'll close the PR.

@ikrivosheev ikrivosheev closed this Nov 8, 2025
@ikrivosheev ikrivosheev deleted the fix/issues-41 branch November 8, 2025 16:34
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.

Malformed FAT entries mismatch

4 participants