diff options
author | Jan Kara <jack@suse.cz> | 2021-06-23 11:36:33 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-06-24 18:43:54 -0600 |
commit | a921c655f2033dd1ce1379128efe881dda23ea37 (patch) | |
tree | 2061a6654f80b0254d23e76cca6d172079dd9dad /block/blk-mq-sched.h | |
parent | 0384264ea8a39bd98c9a3158060565f650c056a6 (diff) | |
download | linux-stable-a921c655f2033dd1ce1379128efe881dda23ea37.tar.gz linux-stable-a921c655f2033dd1ce1379128efe881dda23ea37.tar.bz2 linux-stable-a921c655f2033dd1ce1379128efe881dda23ea37.zip |
bfq: Remove merged request already in bfq_requests_merged()
Currently, bfq does very little in bfq_requests_merged() and handles all
the request cleanup in bfq_finish_requeue_request() called from
blk_mq_free_request(). That is currently safe only because
blk_mq_free_request() is called shortly after bfq_requests_merged()
while bfqd->lock is still held. However to fix a lock inversion between
bfqd->lock and ioc->lock, we need to call blk_mq_free_request() after
dropping bfqd->lock. That would mean that already merged request could
be seen by other processes inside bfq queues and possibly dispatched to
the device which is wrong. So move cleanup of the request from
bfq_finish_requeue_request() to bfq_requests_merged().
Acked-by: Paolo Valente <paolo.valente@linaro.org>
Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20210623093634.27879-2-jack@suse.cz
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-mq-sched.h')
0 files changed, 0 insertions, 0 deletions