]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
blk-mq: Do not invoke .queue_rq() for a stopped queue
authorBart Van Assche <bart.vanassche@sandisk.com>
Mon, 18 Feb 2019 02:55:59 +0000 (10:55 +0800)
committerBrian Maly <brian.maly@oracle.com>
Tue, 19 Feb 2019 19:41:56 +0000 (14:41 -0500)
The meaning of the BLK_MQ_S_STOPPED flag is "do not call
.queue_rq()". Hence modify blk_mq_make_request() such that requests
are queued instead of issued if a queue has been stopped.

Reported-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Ming Lei <tom.leiming@gmail.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Cc: <stable@vger.kernel.org>
Signed-off-by: Jens Axboe <axboe@fb.com>
Orabug: 28766011

commit bc27c01b5c46d3bfec42c96537c7a3fae0bb2cc4 upstream

Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
  - There are so many commits between the most recent uek4 block commit and
    this upstream commit, and blk_mq_make_request() in upstream commit is
    different with uek4. blk_mq_direct_issue_request() is not available.
  - The 3rd argument of blk_mq_insert_request() is set to false in this
    backport because there is no need to run the queue again when it is
    already stopped.

Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
Reviewed-by: Joe Jin <joe.jin@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
block/blk-mq.c

index 4422755604096628c5ee7ef090177d6c52506a79..721960bc5c4b8bfa28d794390a7ec81ea12659f7 100644 (file)
@@ -1257,6 +1257,12 @@ static void blk_mq_make_request(struct request_queue *q, struct bio *bio)
 
                blk_mq_bio_to_request(rq, bio);
 
+               if (unlikely(test_bit(BLK_MQ_S_STOPPED,
+                                     &data.hctx->state))) {
+                       blk_mq_insert_request(rq, false, false, true);
+                       goto done;
+               }
+
                /*
                 * For OK queue, we are done. For error, kill it. Any other
                 * error (busy), just add it to our list as we previously