Skip to content
Commit 2645672f authored by Jens Axboe's avatar Jens Axboe
Browse files

block: pop cached rq before potentially blocking rq_qos_throttle()

If rq_qos_throttle() ends up blocking, then we will have invalidated and
flushed our current plug. Since blk_mq_get_cached_request() hasn't
popped the cached request off the plug list just yet, we end holding a
pointer to a request that is no longer valid. This insta-crashes with
rq->mq_hctx being NULL in the validity checks just after.

Pop the request off the cached list before doing rq_qos_throttle() to
avoid using a potentially stale request.

Fixes: 0a5aa8d1

 ("block: fix blk_mq_attempt_bio_merge and rq_qos_throttle protection")
Reported-by: default avatarDylan Yudaken <dylany@fb.com>
Tested-by: default avatarDylan Yudaken <dylany@fb.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 9243fc4c
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment