Re: [PATCH] rust: block: Fix GenDiskBuilder block size documentation

From: Andreas Hindborg

Date: Mon Aug 31 2026 - 08:57:55 EST


"Sophon Z via B4 Relay" <devnull+aiqubits.hotmail.com@xxxxxxxxxx>
writes:

> From: Sophon Z <aiqubits@xxxxxxxxxxx>
>
> GenDiskBuilder::validate_block_size() accepts powers of two from 512
> through PAGE_SIZE, but the documentation for logical_block_size() and
> physical_block_size() states that the maximum is 4096.
>
> Use PAGE_SIZE for both documented upper bounds so that the documentation
> matches validation on architectures with larger page sizes.
>
> Signed-off-by: Sophon Z <aiqubits@xxxxxxxxxxx>

Acked-by: Andreas Hindborg <a.hindborg@xxxxxxxxxx>

@Jens, please pick this one.

@Sophon I'd like to call the C static inline `blk_validate_block_size`
here instead reproducing the check. Feel free to add a patch. You need
to add a helper in rust/helpers/blk.c to be able to call the function.

You would also need to update the documentation again, as the C function
has special handling when transparent huge pages are enabled. I would
suggest to just saying "check that the block size is valid".

Best regards,
Andreas Hindborg