]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
blk-throttle: fix lockdep warning of "cgroup_mutex or RCU read lock required!"
authorMing Lei <ming.lei@redhat.com>
Fri, 17 Nov 2023 02:35:22 +0000 (10:35 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Dec 2023 14:32:35 +0000 (15:32 +0100)
commita02316281851200b2e77adf42311075413afad72
treeaa08312cd87522b14b514622937d883bc1eba751
parenteac54659ff77706569a8419510ca6676b6ff9827
blk-throttle: fix lockdep warning of "cgroup_mutex or RCU read lock required!"

[ Upstream commit 27b13e209ddca5979847a1b57890e0372c1edcee ]

Inside blkg_for_each_descendant_pre(), both
css_for_each_descendant_pre() and blkg_lookup() requires RCU read lock,
and either cgroup_assert_mutex_or_rcu_locked() or rcu_read_lock_held()
is called.

Fix the warning by adding rcu read lock.

Reported-by: Changhui Zhong <czhong@redhat.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20231117023527.3188627-2-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
block/blk-throttle.c