diff options
-rw-r--r-- | drivers/block/null_blk.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/block/null_blk.c b/drivers/block/null_blk.c index a2e69d26266..a01d7f68fc7 100644 --- a/drivers/block/null_blk.c +++ b/drivers/block/null_blk.c @@ -622,6 +622,11 @@ static int __init null_init(void) irqmode = NULL_IRQ_NONE; } #endif + if (bs > PAGE_SIZE) { + pr_warn("null_blk: invalid block size\n"); + pr_warn("null_blk: defaults block size to %lu\n", PAGE_SIZE); + bs = PAGE_SIZE; + } if (queue_mode == NULL_Q_MQ && use_per_node_hctx) { if (submit_queues < nr_online_nodes) { |