diff options
author | Paolo Valente <paolo.valente@linaro.org> | 2019-08-07 16:17:54 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-08-08 07:30:52 -0600 |
commit | 3f758e844aa9800eb660d60ee10226fa802594d4 (patch) | |
tree | 25fa18af9d966e3f30ad409b51190e61a205fad3 /fs | |
parent | 08d383a74948b43eb6e96c86153e63cbf276f1fa (diff) | |
download | linux-3f758e844aa9800eb660d60ee10226fa802594d4.tar.bz2 |
block, bfq: move update of waker and woken list to queue freeing
Since commit 13a857a4c4e8 ("block, bfq: detect wakers and
unconditionally inject their I/O"), every bfq_queue has a pointer to a
waker bfq_queue and a list of the bfq_queues it may wake. In this
respect, when a bfq_queue, say Q, remains with no I/O source attached
to it, Q cannot be woken by any other bfq_queue, and cannot wake any
other bfq_queue. Then Q must be removed from the woken list of its
possible waker bfq_queue, and all bfq_queues in the woken list of Q
must stop having a waker bfq_queue.
Q remains with no I/O source in two cases: when the last process
associated with Q exits or when such a process gets associated with a
different bfq_queue. Unfortunately, commit 13a857a4c4e8 ("block, bfq:
detect wakers and unconditionally inject their I/O") performed the
above updates only in the first case.
This commit fixes this bug by moving these updates to when Q gets
freed. This is a simple and safe way to handle all cases, as both the
above events, process exit and re-association, lead to Q being freed
soon, and because dangling references would come out only after Q gets
freed (if no update were performed).
Fixes: 13a857a4c4e8 ("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>
Diffstat (limited to 'fs')
0 files changed, 0 insertions, 0 deletions