From: Bart Van Assche Date: Mon, 18 Feb 2019 02:55:59 +0000 (+0800) Subject: blk-mq: Do not invoke .queue_rq() for a stopped queue X-Git-Tag: v4.1.12-124.31.3~275 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=5f55c8235c0d868dc322b79c53aaa50767857689;p=users%2Fjedix%2Flinux-maple.git blk-mq: Do not invoke .queue_rq() for a stopped queue 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 Signed-off-by: Bart Van Assche Reviewed-by: Christoph Hellwig Reviewed-by: Ming Lei Reviewed-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn Reviewed-by: Sagi Grimberg Cc: Signed-off-by: Jens Axboe Orabug: 28766011 commit bc27c01b5c46d3bfec42c96537c7a3fae0bb2cc4 upstream Signed-off-by: Brian Maly 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 Reviewed-by: Joe Jin Signed-off-by: Brian Maly --- diff --git a/block/blk-mq.c b/block/blk-mq.c index 442275560409..721960bc5c4b 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -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