]> 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)
commite5e1df73ebe2af39ad58437d61d752c0e13b2152
tree7b893061ad7cee76de8e1b868b0c23ed45200ffc
parenta845c926d7388689c70bdde6097ad7ae86b0a2d2
block, bfq: reset last_completed_rq_bfqq if the pointed queue is freed

Since commit 2b24cd45e88e ("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: 2b24cd45e88e ("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