On 24/07/2025 12:04, Hannes Reinecke wrote:
On 7/24/25 12:06, John Garry wrote:
On 22/07/2025 11:26, John Garry wrote:
The merging/splitting code and other queue limits checking depends on
the
physical block size being a power-of-2, so enforce it.
JFYI, I have done an audit of all drivers setting physical_block_size
queue limit. I have doubts on a couple, but it seems that NVMe may be
the only driver which does not guarantee a power-of-2 physical block
size - maybe I even am wrong about that.
While there are no real checks on the physical blocksize (all what
matters to the block layer is the logical blocksize) I can't really
see how a device can have a physical blocksize which is _not_ a
multiple of the logical blocksize.
The logical block size must be a power-of-2 and we enforce that already.
So checking the physical block size is a power-of-2 is a stronger check
that just is it a multiple of the LBS.
Wouldn't that be a more meaningful check?
There is code in the queue limits checking and also merging/splitting
code which relies on physical block size being a power-of-2, so that is
why I wanted to enforce it.
Thanks,
John