]> Pileus Git - ~andy/linux/blobdiff - drivers/block/null_blk.c
Merge branch 'for-3.14/drivers' of git://git.kernel.dk/linux-block
[~andy/linux] / drivers / block / null_blk.c
index 83a598ebb65a4ab7699d1dcebe1b44b42ea8ae5a..3107282a9741f96665a2805b08217d3209c27bf7 100644 (file)
@@ -616,6 +616,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) {