From c595572d0e49c79fcefe8db8e3e4f4e6e1fab734 Mon Sep 17 00:00:00 2001 From: Sophon Z Date: Tue, 29 Sep 2026 11:34:04 +0200 Subject: [PATCH] rust: block: Fix GenDiskBuilder block size documentation 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 Acked-by: Andreas Hindborg Link: https://msgid.link/20260831-fix-gendisk-block-size-docs-v1-1-900546005799@hotmail.com Signed-off-by: Andreas Hindborg Link: https://patch.msgid.link/20260929-rust-block-for-v7-4-rc1-b4-v1-6-642a4c1aebd7@kernel.org Signed-off-by: Jens Axboe --- rust/kernel/block/mq/gen_disk.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rust/kernel/block/mq/gen_disk.rs b/rust/kernel/block/mq/gen_disk.rs index 90d364ab3bf2..0fe640f3aec6 100644 --- a/rust/kernel/block/mq/gen_disk.rs +++ b/rust/kernel/block/mq/gen_disk.rs @@ -75,7 +75,7 @@ pub fn validate_block_size(size: u32) -> Result { /// Set the logical block size of the device to be built. /// /// This method will check that block size is a power of two and between 512 - /// and 4096. If not, an error is returned and the block size is not set. + /// and `PAGE_SIZE`. If not, an error is returned and the block size is not set. /// /// This is the smallest unit the storage device can address. It is /// typically 4096 bytes. @@ -88,7 +88,7 @@ pub fn logical_block_size(mut self, block_size: u32) -> Result { /// Set the physical block size of the device to be built. /// /// This method will check that block size is a power of two and between 512 - /// and 4096. If not, an error is returned and the block size is not set. + /// and `PAGE_SIZE`. If not, an error is returned and the block size is not set. /// /// This is the smallest unit a physical storage device can write /// atomically. It is usually the same as the logical block size but may be