Skip to contentSkip to conversation

blk-mq: mq plug list breakage

PATCH New Shaohua Li 1 participant 1 message Oct 29, 2013 Block layer

lore
Share & tools
lore

Shaohua Li

author
#0 lore raw

PATCH 1/1 blk-mq: mq plug list breakage

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

---
 block/blk-core.c |    8 +++++++-
 block/blk-mq.c   |    2 +-
 2 files changed, 8 insertions(+), 2 deletions(-)
block/blk-core.c +7 -1
Index: linux/block/blk-core.c
===================================================================
@@ -1411,6 +1411,7 @@
 	struct blk_plug *plug;
 	struct request *rq;
 	bool ret = false;
+	struct list_head *plug_list;
 
 	if (blk_queue_nomerges(q))
 		goto out;
@@ -1420,7 +1421,12 @@
 		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)
block/blk-mq.c +1 -1
Index: linux/block/blk-mq.c
===================================================================
@@ -950,7 +950,7 @@
 
 		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);