summaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorMing Lei <ming.lei@redhat.com>2021-12-03 03:39:35 +0100
committerJens Axboe <axboe@kernel.dk>2021-12-03 03:57:47 +0100
commit2bfdbe8b7ebd17b5331071071a910fbabc64b436 (patch)
tree30e8f65fd9c4a87d92c5eadd0702468924e619f4 /drivers/block
parentloop: don't hold lo_mutex during __loop_clr_fd() (diff)
downloadlinux-2bfdbe8b7ebd17b5331071071a910fbabc64b436.tar.xz
linux-2bfdbe8b7ebd17b5331071071a910fbabc64b436.zip
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: 15dfc662ef31 ("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>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/null_blk/main.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c
index 54f7d490f8eb..b4ff5ae1f70c 100644
--- a/drivers/block/null_blk/main.c
+++ b/drivers/block/null_blk/main.c
@@ -340,9 +340,9 @@ static int nullb_update_nr_hw_queues(struct nullb_device *dev,
return 0;
/*
- * Make sure at least one queue exists for each of submit and poll.
+ * Make sure at least one submit queue exists.
*/
- if (!submit_queues || !poll_queues)
+ if (!submit_queues)
return -EINVAL;
/*
@@ -1917,8 +1917,6 @@ static int null_validate_conf(struct nullb_device *dev)
if (dev->poll_queues > g_poll_queues)
dev->poll_queues = g_poll_queues;
- else if (dev->poll_queues == 0)
- dev->poll_queues = 1;
dev->prev_poll_queues = dev->poll_queues;
dev->queue_mode = min_t(unsigned int, dev->queue_mode, NULL_Q_MQ);