diff options
Diffstat (limited to 'block/blk-mq.c')
-rw-r--r-- | block/blk-mq.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c index 572966f49596..c7836a1ded97 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c | |||
@@ -2928,8 +2928,17 @@ bool blk_mq_poll(struct request_queue *q, blk_qc_t cookie) | |||
2928 | hctx = q->queue_hw_ctx[blk_qc_t_to_queue_num(cookie)]; | 2928 | hctx = q->queue_hw_ctx[blk_qc_t_to_queue_num(cookie)]; |
2929 | if (!blk_qc_t_is_internal(cookie)) | 2929 | if (!blk_qc_t_is_internal(cookie)) |
2930 | rq = blk_mq_tag_to_rq(hctx->tags, blk_qc_t_to_tag(cookie)); | 2930 | rq = blk_mq_tag_to_rq(hctx->tags, blk_qc_t_to_tag(cookie)); |
2931 | else | 2931 | else { |
2932 | rq = blk_mq_tag_to_rq(hctx->sched_tags, blk_qc_t_to_tag(cookie)); | 2932 | rq = blk_mq_tag_to_rq(hctx->sched_tags, blk_qc_t_to_tag(cookie)); |
2933 | /* | ||
2934 | * With scheduling, if the request has completed, we'll | ||
2935 | * get a NULL return here, as we clear the sched tag when | ||
2936 | * that happens. The request still remains valid, like always, | ||
2937 | * so we should be safe with just the NULL check. | ||
2938 | */ | ||
2939 | if (!rq) | ||
2940 | return false; | ||
2941 | } | ||
2933 | 2942 | ||
2934 | return __blk_mq_poll(hctx, rq); | 2943 | return __blk_mq_poll(hctx, rq); |
2935 | } | 2944 | } |