All block devices that are supported by the Linux kernel have a DMA engine that supports DMA segments of 4 KiB or larger. Allow smaller DMA segment sizes because these are useful for block layer testing. Reject values below 512 because such values would result in an excessive number of DMA segments. The only code affected by this change is the following code: if (WARN_ON_ONCE(lim->max_segment_size < BLK_MIN_SEGMENT_SIZE)) return -EINVAL; Cc: Ming Lei Cc: Christoph Hellwig Signed-off-by: Bart Van Assche --- block/blk.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk.h b/block/blk.h index 7082dd5a87f9..7c792c012b0d 100644 --- a/block/blk.h +++ b/block/blk.h @@ -23,7 +23,7 @@ struct elv_change_ctx; #define BLK_DEF_MAX_SECTORS_CAP (SZ_4M >> SECTOR_SHIFT) #define BLK_DEV_MAX_SECTORS (LLONG_MAX >> 9) -#define BLK_MIN_SEGMENT_SIZE 4096 +#define BLK_MIN_SEGMENT_SIZE 512 /* Max future timer expiry for timeouts */ #define BLK_MAX_TIMEOUT (5 * HZ)