Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bc27c01b authored by Bart Van Assche's avatar Bart Van Assche Committed by Jens Axboe
Browse files

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: default avatarMing Lei <tom.leiming@gmail.com>
Signed-off-by: default avatarBart Van Assche <bart.vanassche@sandisk.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarMing Lei <tom.leiming@gmail.com>
Reviewed-by: default avatarHannes Reinecke <hare@suse.com>
Reviewed-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent 2cefe4db
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -1317,8 +1317,8 @@ static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio)
		blk_mq_put_ctx(data.ctx);
		blk_mq_put_ctx(data.ctx);
		if (!old_rq)
		if (!old_rq)
			goto done;
			goto done;
		if (!blk_mq_direct_issue_request(old_rq, &cookie))
		if (test_bit(BLK_MQ_S_STOPPED, &data.hctx->state) ||
			goto done;
		    blk_mq_direct_issue_request(old_rq, &cookie) != 0)
			blk_mq_insert_request(old_rq, false, true, true);
			blk_mq_insert_request(old_rq, false, true, true);
		goto done;
		goto done;
	}
	}