]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - block/blk-mq.c
block: deal with stale req count of plug list
[karo-tx-linux.git] / block / blk-mq.c
index ae8df5ec20d3860663bad8bdd2ef271f8eadc491..f39e69c732cc628c7fa54802160a2c495b28e87d 100644 (file)
@@ -1497,6 +1497,13 @@ static blk_qc_t blk_sq_make_request(struct request_queue *q, struct bio *bio)
                struct request *last = NULL;
 
                blk_mq_bio_to_request(rq, bio);
+
+               /*
+                * @request_count may become stale because of schedule
+                * out, so check the list again.
+                */
+               if (list_empty(&plug->mq_list))
+                       request_count = 0;
                if (!request_count)
                        trace_block_plug(q);
                else