]> 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)
commitd902558485bfbab4956a9555d37ff6e42672a823
tree369e7828eca8e73a2d662aa8152fcb9cf4d5120c
parentebdff510d383826b14a20615f50544ba3e934d77
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: 1dfbfa22b938 ("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