Re: [PATCH v5 2/6] block: sanitize chunk_sectors for atomic write limits

From: John Garry
Date: Thu Jul 10 2025 - 11:19:25 EST


On 10/07/2025 16:08, Jens Axboe wrote:
+ chunk_bytes = lim->chunk_sectors << SECTOR_SHIFT;
+ if (chunk_bytes) {
+ if (WARN_ON_ONCE(lim->atomic_write_hw_unit_max >
+ chunk_bytes))
+ goto unsupported;
+ }
Unnecessary indentation here. Why not just:

chunk_bytes = lim->chunk_sectors << SECTOR_SHIFT;
if (WARN_ON_ONCE(chunk_bytes &&
lim->atomic_write_hw_unit_max > chunk_bytes))
goto unsupposed.

Also avoids splitting a comparison over multiple lines, which is always
annoying to read.

ok, I can tidy that up.

Thanks,
John