summaryrefslogtreecommitdiffstats
path: root/block/blk-mq.c
diff options
context:
space:
mode:
authorMing Lei <ming.lei@redhat.com>2018-12-17 23:15:29 -0500
committerJens Axboe <axboe@kernel.dk>2018-12-17 23:35:07 -0500
commitcd19181bf9ad4b7f40f2a4e0355d052109c76529 (patch)
tree30896b4375d72ec6097eedfebaf193b368d9db0e /block/blk-mq.c
parent3c94d83cb352627f221d971b05f163c17527de74 (diff)
blk-mq: enable IO poll if .nr_queues of type poll > 0
The queue mapping of type poll only exists when set->map[HCTX_TYPE_POLL].nr_queues is bigger than zero, so enhance the constraint by checking .nr_queues of type poll before enabling IO poll. Otherwise IO race & timeout can be observed when running block/007. Cc: Jeff Moyer <jmoyer@redhat.com> Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Ming Lei <ming.lei@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-mq.c')
-rw-r--r--block/blk-mq.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index b0888a89fa66..2de972857496 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -2833,7 +2833,8 @@ struct request_queue *blk_mq_init_allocated_queue(struct blk_mq_tag_set *set,
2833 q->tag_set = set; 2833 q->tag_set = set;
2834 2834
2835 q->queue_flags |= QUEUE_FLAG_MQ_DEFAULT; 2835 q->queue_flags |= QUEUE_FLAG_MQ_DEFAULT;
2836 if (set->nr_maps > HCTX_TYPE_POLL) 2836 if (set->nr_maps > HCTX_TYPE_POLL &&
2837 set->map[HCTX_TYPE_POLL].nr_queues)
2837 blk_queue_flag_set(QUEUE_FLAG_POLL, q); 2838 blk_queue_flag_set(QUEUE_FLAG_POLL, q);
2838 2839
2839 if (!(set->flags & BLK_MQ_F_SG_MERGE)) 2840 if (!(set->flags & BLK_MQ_F_SG_MERGE))