Re: [PATCH RFC 2/2] block: Enforce power-of-2 physical block size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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






[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux