]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
blk-mq: test QUEUE_FLAG_HCTX_ACTIVE for sbitmap_shared in hctx_may_queue
authorMing Lei <ming.lei@redhat.com>
Sun, 27 Dec 2020 11:34:58 +0000 (19:34 +0800)
committerJens Axboe <axboe@kernel.dk>
Mon, 25 Jan 2021 04:25:17 +0000 (21:25 -0700)
In case of blk_mq_is_sbitmap_shared(), we should test QUEUE_FLAG_HCTX_ACTIVE against
q->queue_flags instead of BLK_MQ_S_TAG_ACTIVE.

So fix it.

Cc: John Garry <john.garry@huawei.com>
Cc: Kashyap Desai <kashyap.desai@broadcom.com>
Fixes: f1b49fdc1c64 ("blk-mq: Record active_queues_shared_sbitmap per tag_set for when using shared sbitmap")
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: John Garry <john.garry@huawei.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-mq.h

index c1458d9502f1c6566cfa22d4acd268f87457e08f..3616453ca28c8f3be4763b30ccc3acf7f700d127 100644 (file)
@@ -304,7 +304,7 @@ static inline bool hctx_may_queue(struct blk_mq_hw_ctx *hctx,
                struct request_queue *q = hctx->queue;
                struct blk_mq_tag_set *set = q->tag_set;
 
-               if (!test_bit(BLK_MQ_S_TAG_ACTIVE, &q->queue_flags))
+               if (!test_bit(QUEUE_FLAG_HCTX_ACTIVE, &q->queue_flags))
                        return true;
                users = atomic_read(&set->active_queues_shared_sbitmap);
        } else {