]> git.baikalelectronics.ru Git - kernel.git/commit
blk-mq: fix potential oops with polling and blk-mq scheduler
authorJens Axboe <axboe@fb.com>
Thu, 20 Apr 2017 20:53:28 +0000 (14:53 -0600)
committerJens Axboe <axboe@fb.com>
Thu, 20 Apr 2017 20:53:28 +0000 (14:53 -0600)
commit55d8b5aebe12b50f541f3b646b52658e723eaefe
tree369e7828eca8e73a2d662aa8152fcb9cf4d5120c
parent42a9f523186e75f21c8d6c5e45bfb1713fdfdba7
blk-mq: fix potential oops with polling and blk-mq scheduler

If we have a scheduler attached, blk_mq_tag_to_rq() on the
scheduled tags will return NULL if a request is no longer
in flight. This is different than using the normal tags,
where it will always return the fixed request. Check for
this condition for polling, in case we happen to enter
polling for a completed request.

The request address remains valid, so this check and return
should be perfectly safe.

Fixes: f0679950ad9f ("blk-mq-sched: add framework for MQ capable IO schedulers")
Tested-by: Stephen Bates <sbates@raithlin.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
block/blk-mq.c