summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--block/blk-core.c8
-rw-r--r--block/blk-mq.c2
2 files changed, 8 insertions, 2 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index 9677c6525ed8..936876ab662d 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1401,13 +1401,19 @@ bool blk_attempt_plug_merge(struct request_queue *q, struct bio *bio,
struct blk_plug *plug;
struct request *rq;
bool ret = false;
+ struct list_head *plug_list;
plug = current->plug;
if (!plug)
goto out;
*request_count = 0;
- list_for_each_entry_reverse(rq, &plug->list, queuelist) {
+ if (q->mq_ops)
+ plug_list = &plug->mq_list;
+ else
+ plug_list = &plug->list;
+
+ list_for_each_entry_reverse(rq, plug_list, queuelist) {
int el_ret;
if (rq->q == q)
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 2dc8de86d0d2..88d4e864d4c0 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -950,7 +950,7 @@ static void blk_mq_make_request(struct request_queue *q, struct bio *bio)
if (plug) {
blk_mq_bio_to_request(rq, bio);
- if (list_empty(&plug->list))
+ if (list_empty(&plug->mq_list))
trace_block_plug(q);
else if (request_count >= BLK_MAX_REQUEST_COUNT) {
blk_flush_plug_list(plug, false);