]> git.baikalelectronics.ru Git - kernel.git/commit
null_blk: do not fail the module load with zero devices
authorAndré Almeida <andrealmeid@collabora.com>
Mon, 16 Sep 2019 14:07:57 +0000 (11:07 -0300)
committerJens Axboe <axboe@kernel.dk>
Mon, 16 Sep 2019 14:38:26 +0000 (08:38 -0600)
commit2168dc7d28b3d8726e264cf79a43682d3581321b
tree82acaf7b6544f83e79410edba6ebd6fe7577b76f
parenta9de477bb00af6a5447ff113405f11f3d686af08
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: 44bda2037961 ("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>
drivers/block/null_blk_main.c