Skip to content
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

Sector size issues #94

Open
reynir opened this issue Oct 27, 2022 · 0 comments
Open

Sector size issues #94

reynir opened this issue Oct 27, 2022 · 0 comments

Comments

@reynir
Copy link
Member

reynir commented Oct 27, 2022

The sector size in mirage-block-xen is at least 4096 bytes no matter what the backing block device may report. I think there could be issues if the backing block device is actually 512 bytes although that should be rare today I guess.

max t.t.info.sector_size minimum_sector_size

In read and write we call to_iopages on the buffers, and this raises an exception(!!) if any of the buffers is not exactly 4096 bytes. This means that we simply can't use a block device if the backing block device has a sector size greater than 4096 bytes.

if x.Cstruct.len <> 4096 then raise Buffer_not_exactly_one_page;

So the issues I see are:

  1. the sector size can't be smaller than 512 bytes (but that's maybe ok)
  2. there's an implicit expectation that the mirage-exposed sector size (the one from Mirage_block.S.get_info) is exactly 4096 bytes
  3. one can't write or read from/into buffers larger than 4096 bytes, let's say one sector. The mirage-block documentation doesn't explicitly allow this, but this is like in mirage-block-solo5.
  4. an exception is raised if any of the buffers isn't exactly 4096 bytes instead of returning an error. And the exception is not exposed, either!
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

No branches or pull requests

1 participant