]> www.infradead.org Git - users/dwmw2/linux.git/commit
rq-qos: use a mb for got_token
authorJosef Bacik <josef@toxicpanda.com>
Tue, 16 Jul 2019 20:19:29 +0000 (16:19 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Aug 2019 08:11:00 +0000 (10:11 +0200)
commitae3afb0ab0b6650644f7d0487d01d62322e4ac58
treeeed22dc723c71e04a28b8b6323b3172f3267c769
parent32d1d7051c67ecd8f070c45785efab0322380db3
rq-qos: use a mb for got_token

[ Upstream commit ac38297f7038cd5b80d66f8809c7bbf5b70031f3 ]

Oleg noticed that our checking of data.got_token is unsafe in the
cleanup case, and should really use a memory barrier.  Use a wmb on the
write side, and a rmb() on the read side.  We don't need one in the main
loop since we're saved by set_current_state().

Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
block/blk-rq-qos.c