summaryrefslogtreecommitdiff
path: root/block/blk-mq.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2018-11-28 03:07:17 +0300
committerJens Axboe <axboe@kernel.dk>2018-11-28 16:29:23 +0300
commit4711b57317f0ff5ca9fbd5e2df6c73b2c07ddc53 (patch)
treef3e23d67110eaff30ca87ccdaa90c1c89672729e /block/blk-mq.c
parenta11f6ca9aef989b56cd31ff4ee2af4fb31a172ec (diff)
downloadlinux-4711b57317f0ff5ca9fbd5e2df6c73b2c07ddc53.tar.xz
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: 5f0ed774ed29 ("block: sum requests in the plug structure") Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-mq.c')
-rw-r--r--block/blk-mq.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 7b7dff85cf6c..a82830f39933 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -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))
same_queue_rq = NULL;
- if (same_queue_rq)
+ if (same_queue_rq) {
list_del_init(&same_queue_rq->queuelist);
+ plug->rq_count--;
+ }
list_add_tail(&rq->queuelist, &plug->mq_list);
plug->rq_count++;