|
@@ -2928,8 +2928,17 @@ bool blk_mq_poll(struct request_queue *q, blk_qc_t cookie)
|
|
|
hctx = q->queue_hw_ctx[blk_qc_t_to_queue_num(cookie)];
|
|
|
if (!blk_qc_t_is_internal(cookie))
|
|
|
rq = blk_mq_tag_to_rq(hctx->tags, blk_qc_t_to_tag(cookie));
|
|
|
- else
|
|
|
+ else {
|
|
|
rq = blk_mq_tag_to_rq(hctx->sched_tags, blk_qc_t_to_tag(cookie));
|
|
|
+ /*
|
|
|
+ * With scheduling, if the request has completed, we'll
|
|
|
+ * get a NULL return here, as we clear the sched tag when
|
|
|
+ * that happens. The request still remains valid, like always,
|
|
|
+ * so we should be safe with just the NULL check.
|
|
|
+ */
|
|
|
+ if (!rq)
|
|
|
+ return false;
|
|
|
+ }
|
|
|
|
|
|
return __blk_mq_poll(hctx, rq);
|
|
|
}
|