Re: [PATCH v2 0/1] scsi: sas: fix mkfs.xfs failure due to bogus optimal_io_size

From: John Garry

Date: Wed Mar 18 2026 - 04:53:46 EST


On 18/03/2026 07:43, Ionut Nechita (Wind River) wrote:
Answer to John's question about blk_validate_limits() rounding:
blk_validate_limits() rounds optimal_io_size down to physical_block_size
(4096), but does NOT enforce that optimal_io_size is a multiple of
minimum_io_size (8192). So optimal_io_size=16773120 survives validation
unchanged — it is already a multiple of 4096. The mismatch only shows
up when mkfs.xfs divides optimal_io_size by minimum_io_size and expects
an integer result: 16773120 / 8192 = 2047.5, giving swidth=4095 and
sunit=2, with 4095 % 2 != 0.

thanks for the info. I feel that that io_opt should be a multiple of the io_min and we should enforce it in blk queue limits validation, but that can mask problems like you have seen.