Commit 4711b573 authored by Jens Axboe's avatar Jens Axboe

blk-mq: fix failure to decrement plug count on single rq removal

If we yank a 'same_queue_rq' request off the plug list, we should
also decrement the cached request count.

Fixes: 5f0ed774 ("block: sum requests in the plug structure")
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent a11f6ca9
...@@ -1946,8 +1946,10 @@ static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio) ...@@ -1946,8 +1946,10 @@ static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio)
*/ */
if (list_empty(&plug->mq_list)) if (list_empty(&plug->mq_list))
same_queue_rq = NULL; same_queue_rq = NULL;
if (same_queue_rq) if (same_queue_rq) {
list_del_init(&same_queue_rq->queuelist); list_del_init(&same_queue_rq->queuelist);
plug->rq_count--;
}
list_add_tail(&rq->queuelist, &plug->mq_list); list_add_tail(&rq->queuelist, &plug->mq_list);
plug->rq_count++; plug->rq_count++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment