Commit 92f399c72af2d8cbb9d4f60e11d0d67ca738147f

Authored by Shaohua Li
Committed by Jens Axboe
1 parent 3228f48be2

blk-mq: mq plug list breakage

We switched to plug mq_list for mq, but some code are still using old list.

Signed-off-by: Shaohua Li <shli@fusionio.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

Showing 2 changed files with 8 additions and 2 deletions Side-by-side Diff

... ... @@ -1401,13 +1401,19 @@
1401 1401 struct blk_plug *plug;
1402 1402 struct request *rq;
1403 1403 bool ret = false;
  1404 + struct list_head *plug_list;
1404 1405  
1405 1406 plug = current->plug;
1406 1407 if (!plug)
1407 1408 goto out;
1408 1409 *request_count = 0;
1409 1410  
1410   - list_for_each_entry_reverse(rq, &plug->list, queuelist) {
  1411 + if (q->mq_ops)
  1412 + plug_list = &plug->mq_list;
  1413 + else
  1414 + plug_list = &plug->list;
  1415 +
  1416 + list_for_each_entry_reverse(rq, plug_list, queuelist) {
1411 1417 int el_ret;
1412 1418  
1413 1419 if (rq->q == q)
... ... @@ -950,7 +950,7 @@
950 950  
951 951 if (plug) {
952 952 blk_mq_bio_to_request(rq, bio);
953   - if (list_empty(&plug->list))
  953 + if (list_empty(&plug->mq_list))
954 954 trace_block_plug(q);
955 955 else if (request_count >= BLK_MAX_REQUEST_COUNT) {
956 956 blk_flush_plug_list(plug, false);