]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
block: ensure we hold a queue reference when using queue limits
authorJens Axboe <axboe@kernel.dk>
Fri, 12 Jan 2024 16:12:20 +0000 (09:12 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jan 2024 23:45:27 +0000 (15:45 -0800)
commit85fedfd9916c677bc1179468406dbb3581ee3a95
tree1aaecd7b8a1a4da0e333c749c12c01e524bf2900
parent3a13eb36bbaabc35968fab94d12c9b836ddca373
block: ensure we hold a queue reference when using queue limits

[ Upstream commit 7b4f36cd22a65b750b4cb6ac14804fb7d6e6c67d ]

q_usage_counter is the only thing preventing us from the limits changing
under us in __bio_split_to_limits, but blk_mq_submit_bio doesn't hold
it while calling into it.

Move the splitting inside the region where we know we've got a queue
reference. Ideally this could still remain a shared section of code, but
let's keep the fix simple and defer any refactoring here to later.

Reported-by: Christoph Hellwig <hch@lst.de>
Fixes: 900e08075202 ("block: move queue enter logic into blk_mq_submit_bio()")
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
block/blk-mq.c