diff options
author | André Almeida <andrealmeid@collabora.com> | 2019-09-16 11:07:57 -0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-09-16 08:38:26 -0600 |
commit | 4467453502f1a2b177c43867119e54671d78b6de (patch) | |
tree | 82acaf7b6544f83e79410edba6ebd6fe7577b76f /drivers/block/null_blk_main.c | |
parent | 9a91b05bba58e5bd83034e69407d11641e8064e9 (diff) | |
download | linux-4467453502f1a2b177c43867119e54671d78b6de.tar.bz2 |
null_blk: do not fail the module load with zero devices
The module load should fail only if there is something wrong with the
configuration or if an error prevents it to work properly. The module
should be able to be loaded with (nr_device == 0), since it will not
trigger errors or be in malfunction state. Preventing loading with zero
devices also breaks applications that configures this module using
configfs API. Remove the nr_device check to fix this.
Fixes: f7c4ce890dd2 ("null_blk: validate the number of devices")
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: André Almeida <andrealmeid@collabora.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block/null_blk_main.c')
-rw-r--r-- | drivers/block/null_blk_main.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/drivers/block/null_blk_main.c b/drivers/block/null_blk_main.c index 53d4c1529984..909154b73b8a 100644 --- a/drivers/block/null_blk_main.c +++ b/drivers/block/null_blk_main.c @@ -1767,10 +1767,6 @@ static int __init null_init(void) pr_err("null_blk: legacy IO path no longer available\n"); return -EINVAL; } - if (!nr_devices) { - pr_err("null_blk: invalid number of devices\n"); - return -EINVAL; - } if (g_queue_mode == NULL_Q_MQ && g_use_per_node_hctx) { if (g_submit_queues != nr_online_nodes) { pr_warn("null_blk: submit_queues param is set to %u.\n", |