Skip to content

Commit 2bfdbe8

Browse files
Ming Leiaxboe
authored andcommitted
null_blk: allow zero poll queues
There isn't any reason to not allow zero poll queues from user viewpoint. Also sometimes we need to compare io poll between poll mode and irq mode, so not allowing poll queues is bad. Fixes: 15dfc66 ("null_blk: Fix handling of submit_queues and poll_queues attributes") Cc: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com> Signed-off-by: Ming Lei <ming.lei@redhat.com> Link: https://lore.kernel.org/r/20211203023935.3424042-1-ming.lei@redhat.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 6050fa4 commit 2bfdbe8

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

‎drivers/block/null_blk/main.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -340,9 +340,9 @@ static int nullb_update_nr_hw_queues(struct nullb_device *dev,
340340
return 0;
341341

342342
/*
343-
* Make sure at least one queue exists for each of submit and poll.
343+
* Make sure at least one submit queue exists.
344344
*/
345-
if (!submit_queues || !poll_queues)
345+
if (!submit_queues)
346346
return -EINVAL;
347347

348348
/*
@@ -1917,8 +1917,6 @@ static int null_validate_conf(struct nullb_device *dev)
19171917

19181918
if (dev->poll_queues > g_poll_queues)
19191919
dev->poll_queues = g_poll_queues;
1920-
else if (dev->poll_queues == 0)
1921-
dev->poll_queues = 1;
19221920
dev->prev_poll_queues = dev->poll_queues;
19231921

19241922
dev->queue_mode = min_t(unsigned int, dev->queue_mode, NULL_Q_MQ);

0 commit comments

Comments
 (0)