Re: [PATCH] block: Return the soft block size for compat BLKBSZGET

From: Jens Axboe

Date: Tue Nov 03 2026 - 09:38:14 EST



On Fri, 23 Oct 2026 15:36:45 +0000, Hungyu Lin wrote:
> BLKBSZGET returns the block device's soft block size, while BLKSSZGET
> returns its logical sector size. The compat BLKBSZGET_32 handler uses
> bdev_logical_block_size(), so it returns the wrong value when these
> sizes differ.
>
> For example, on an x86_64 kernel a native query of a RAM or loop device
> with 512-byte logical sectors returns the initial soft block size of
> 4096 bytes, but an i386 process gets 512 bytes. This makes 32-bit
> blockdev --getbsz and the BSZ column of --report disagree with native
> queries, even without a preceding BLKBSZSET.
>
> [...]

Applied, thanks!

[1/1] block: Return the soft block size for compat BLKBSZGET
commit: 57cd1a08717690e5ea01d7ac7a96bb33a2dca117

Best regards,
--
Jens Axboe