-
Notifications
You must be signed in to change notification settings - Fork 23
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
Check file is sector aligned #117
Conversation
I think @Julow is probably interesting by this PR when he already did some works about that. |
I'm in favour of this. But could you fix the tests so that CI has a chance to pass? |
It seems to pass now except for the AppVeyor build which fails for unrelated reasons. While updating the test I thought about creating a new exception rather than using |
Yes, we should definitely delete AppVeyor. |
Maybe worth to replace AppVeyor by GitHub action (so we don't loose testing on windows)? |
Otherwise we have to make up non-existing bytes, and that's a mess.
Not sure if `buffered` is relevant.
b29afc8
to
a6d00c6
Compare
The other tests don't do it so maybe it's fine!?
41dfc56
to
dbab1e4
Compare
CHANGES: * Raise an exception on connect if the file is not aligned to the `sector_size` (mirage/mirage-block-unix#117, @reynir) * Demote log to debug when an error is returned (mirage/mirage-block-unix#119 @reynir, fixes mirage/mirage-block-unix#109) * Remove io-page dependency (mirage/mirage-block-unix#118 @hannesm) * Add GitHub actions for testing on macos and windows (retire Appveyor)
As it is now you can attach to files which are not aligned with the sector size (often 512 bytes), and you only get a warning about this if you connect with
~buffered:false
(not the default). Then mirage-block-unix on read will conjure up zero bytes to make up for the non-existing bytes. My opinion is that it's bad behavior to return bytes that aren't there on the disk.This change checks in
connect
that the file is sector-aligned, and simplifies theread
code.See also Solo5/solo5#527.