]> git.baikalelectronics.ru Git - kernel.git/commit
block: null_blk: only set set->nr_maps as 3 if active poll_queues is > 0
authorMing Lei <ming.lei@redhat.com>
Fri, 24 Dec 2021 01:08:31 +0000 (09:08 +0800)
committerJens Axboe <axboe@kernel.dk>
Fri, 24 Dec 2021 05:05:50 +0000 (22:05 -0700)
commit7d5b35d8a8c047cd57296d37d2f9f247b188bad8
tree6c49a365817627a187e73586b3918ee333dc91d0
parent80077bc9b746a1773ad6c8dd4bf8a374a200dbcb
block: null_blk: only set set->nr_maps as 3 if active poll_queues is > 0

It isn't correct to set set->nr_maps as 3 if g_poll_queues is > 0 since
we can change it via configfs for null_blk device created there, so only
set it as 3 if active poll_queues is > 0.

Fixes divide zero exception reported by Shinichiro.

Fixes: 40bba9adcbc7 ("null_blk: allow zero poll queues")
Reported-by: Shinichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Link: https://lore.kernel.org/r/20211224010831.1521805-1-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/null_blk/main.c