]> git.baikalelectronics.ru Git - kernel.git/commit
block, bfq: reset last_completed_rq_bfqq if the pointed queue is freed
authorPaolo Valente <paolo.valente@linaro.org>
Wed, 7 Aug 2019 14:17:53 +0000 (16:17 +0200)
committerJens Axboe <axboe@kernel.dk>
Thu, 8 Aug 2019 13:30:50 +0000 (07:30 -0600)
commit7251d5f313ad9ddcd60e190831fbec2747c243f6
tree7b893061ad7cee76de8e1b868b0c23ed45200ffc
parent348e6ed0a6196d50adc0d74466e0627fa6cec740
block, bfq: reset last_completed_rq_bfqq if the pointed queue is freed

Since commit 756d7ae91892 ("block, bfq: detect wakers and
unconditionally inject their I/O"), BFQ stores, in a per-device
pointer last_completed_rq_bfqq, the last bfq_queue that had an I/O
request completed. If some bfq_queue receives new I/O right after the
last request of last_completed_rq_bfqq has been completed, then
last_completed_rq_bfqq may be a waker bfq_queue.

But if the bfq_queue last_completed_rq_bfqq points to is freed, then
last_completed_rq_bfqq becomes a dangling reference. This commit
resets last_completed_rq_bfqq if the pointed bfq_queue is freed.

Fixes: 756d7ae91892 ("block, bfq: detect wakers and unconditionally inject their I/O")
Reported-by: Douglas Anderson <dianders@chromium.org>
Tested-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Paolo Valente <paolo.valente@linaro.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/bfq-iosched.c