Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

block: fix virt_boundary handling in blk_validate_limits

Don't set the default max_segment_size value when a virt_boundary is
used.

Fixes: d690cb8ae14b ("block: add an API to atomically update queue limits")
Reported-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20240221125010.3609444-1-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Christoph Hellwig and committed by
Jens Axboe
a3911966 e440626b

+10 -10
+10 -10
block/blk-settings.c
··· 183 183 return -EINVAL; 184 184 185 185 /* 186 - * The maximum segment size has an odd historic 64k default that 187 - * drivers probably should override. Just like the I/O size we 188 - * require drivers to at least handle a full page per segment. 189 - */ 190 - if (!lim->max_segment_size) 191 - lim->max_segment_size = BLK_MAX_SEGMENT_SIZE; 192 - if (WARN_ON_ONCE(lim->max_segment_size < PAGE_SIZE)) 193 - return -EINVAL; 194 - 195 - /* 196 186 * Devices that require a virtual boundary do not support scatter/gather 197 187 * I/O natively, but instead require a descriptor list entry for each 198 188 * page (which might not be identical to the Linux PAGE_SIZE). Because ··· 193 203 lim->max_segment_size != UINT_MAX)) 194 204 return -EINVAL; 195 205 lim->max_segment_size = UINT_MAX; 206 + } else { 207 + /* 208 + * The maximum segment size has an odd historic 64k default that 209 + * drivers probably should override. Just like the I/O size we 210 + * require drivers to at least handle a full page per segment. 211 + */ 212 + if (!lim->max_segment_size) 213 + lim->max_segment_size = BLK_MAX_SEGMENT_SIZE; 214 + if (WARN_ON_ONCE(lim->max_segment_size < PAGE_SIZE)) 215 + return -EINVAL; 196 216 } 197 217 198 218 /*