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 16:01:55 +0000 (17:01 +0100)
commit5aba47ce61b7c277246e367f51fdcc930af6a699
tree1d97a21fe3fa7982f669ea3afda8166dab1b3de0
parent462f1111d9459baa1ff98c3bc966b64d480b9ea0
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