回复: [PATCH] rust: block: Fix GenDiskBuilder block size documentation

From: ai qubits

Date: Tue Sep 01 2026 - 05:59:23 EST


Thanks for the review and the Ack.

Understood. I will leave this documentation fix as-is for Jens to pick up
and prepare a separate follow-up patch after it lands.

The follow-up will add a helper in rust/helpers/blk.c for
blk_validate_block_size(), use it from
GenDiskBuilder::validate_block_size(), and update the documentation to
avoid specifying a configuration-dependent upper bound.

Best regards,
Sophon

// Reason for Resending

Note: I don't think your messages will be accepted by the mailing
list, since they use HTML. Please switch to plain text -- thanks!

Cheers,
Miguel

Hi Miguel,
Thanks for the reminder. I will resend it in plain text.

Best regards,
Sophon

________________________________________
发件人: ai qubits <aiqubits@xxxxxxxxxxx>
发送时间: 2026年9月1日 10:00
收件人: Andreas Hindborg; Sophon Z via B4 Relay; Boqun Feng; Miguel Ojeda; Gary Guo; Björn Roy Baron; Benno Lossin; Alice Ryhl; Trevor Gross; Danilo Krummrich; Daniel Almeida; Tamir Duberstein; Alexandre Courbot; Onur Özkan
抄送: linux-block@xxxxxxxxxxxxxxx; rust-for-linux@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx
主题: 回复: [PATCH] rust: block: Fix GenDiskBuilder block size documentation

Thanks for the review and the Ack.

Understood. I will leave this documentation fix as-is for Jens to pick up
and prepare a separate follow-up patch after it lands.

The follow-up will add a helper in rust/helpers/blk.c for
blk_validate_block_size(), use it from
GenDiskBuilder::validate_block_size(), and update the documentation to
avoid specifying a configuration-dependent upper bound.

Best regards,
Sophon
________________________________
发件人: Andreas Hindborg <a.hindborg@xxxxxxxxxx>
发送时间: 2026年8月31日 20:55
收件人: Sophon Z via B4 Relay <devnull+aiqubits.hotmail.com@xxxxxxxxxx>; Boqun Feng <boqun@xxxxxxxxxx>; Miguel Ojeda <ojeda@xxxxxxxxxx>; Gary Guo <gary@xxxxxxxxxxx>; Björn Roy Baron <bjorn3_gh@xxxxxxxxxxxxxx>; Benno Lossin <lossin@xxxxxxxxxx>; Alice Ryhl <aliceryhl@xxxxxxxxxx>; Trevor Gross <tmgross@xxxxxxxxx>; Danilo Krummrich <dakr@xxxxxxxxxx>; Daniel Almeida <daniel.almeida@xxxxxxxxxxxxx>; Tamir Duberstein <tamird@xxxxxxxxxx>; Alexandre Courbot <acourbot@xxxxxxxxxx>; Onur Özkan <work@xxxxxxxxxxxxx>
抄送: linux-block@xxxxxxxxxxxxxxx <linux-block@xxxxxxxxxxxxxxx>; rust-for-linux@xxxxxxxxxxxxxxx <rust-for-linux@xxxxxxxxxxxxxxx>; linux-kernel@xxxxxxxxxxxxxxx <linux-kernel@xxxxxxxxxxxxxxx>; Sophon Z <aiqubits@xxxxxxxxxxx>
主题: Re: [PATCH] rust: block: Fix GenDiskBuilder block size documentation

"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