From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Subject: [PATCH 01/12] blk-mq: Do not invoke .queue_rq() for a stopped queue To: Jens Axboe References: From: Bart Van Assche Message-ID: <1debcf7f-c950-308b-d297-3e48a77e08d7@sandisk.com> Date: Wed, 26 Oct 2016 15:50:44 -0700 MIME-Version: 1.0 In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "linux-block@vger.kernel.org" , Ming Lin , James Bottomley , "Martin K. Petersen" , Mike Snitzer , "linux-rdma@vger.kernel.org" , "linux-nvme@lists.infradead.org" , Keith Busch , Doug Ledford , "linux-scsi@vger.kernel.org" , Laurence Oberman , Christoph Hellwig Content-Type: text/plain; charset="us-ascii" Sender: "Linux-nvme" Errors-To: linux-nvme-bounces+axboe=kernel.dk@lists.infradead.org List-ID: 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 Cc: Hannes Reinecke Cc: Sagi Grimberg Cc: Johannes Thumshirn Cc: --- block/blk-mq.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index ddc2eed..b5dcafb 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -1332,9 +1332,9 @@ static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio) blk_mq_put_ctx(data.ctx); if (!old_rq) goto done; - if (!blk_mq_direct_issue_request(old_rq, &cookie)) - goto done; - blk_mq_insert_request(old_rq, false, true, true); + if (test_bit(BLK_MQ_S_STOPPED, &data.hctx->state) || + blk_mq_direct_issue_request(old_rq, &cookie) != 0) + blk_mq_insert_request(old_rq, false, true, true); goto done; } -- 2.10.1 _______________________________________________ Linux-nvme mailing list Linux-nvme@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-nvme