Re: [PATCH 23/79] block: rust: change sector type from usize to u64
From: Alice Ryhl
Date: Mon Mar 16 2026 - 07:00:33 EST
On Mon, Feb 16, 2026 at 12:35:10AM +0100, Andreas Hindborg wrote:
> Change the `sector()` and `sectors()` methods in `Request` to return
> `u64` and `u32` respectively instead of `usize`. This matches the
> underlying kernel types.
>
> Update rnull driver to handle the new sector types with appropriate
> casting throughout the read, write, and discard operations.
>
> Signed-off-by: Andreas Hindborg <a.hindborg@xxxxxxxxxx>
This has lots of unchecked casts from u64 to usize, which could overflow
on 32-bit systems. Could use some CAST: comments or similar.
Alice