On 30/10/2024 14:13, John Garry wrote:
On Wed, Oct 30, 2024 at 11:19:00AM +0000, John Garry wrote:
+ granularity = bdev_discard_granularity(bdev) ?:
+ bdev_physical_block_size(bdev);
The discard granularity is always set to at least the physical block
size, so this can be simplified to:
granularity = bdev_discard_granularity(bdev);
ok, I see that set in blk_validate_limits()
BTW, can the check for granularity ever fail in
queue_limit_discard_alignment()
static unsigned int queue_limit_discard_alignment(...)
{
...
granularity = lim->discard_granularity >> SECTOR_SHIFT;
if (!granularity)
return 0;