]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
blk-cgroup: hold queue_lock when removing blkg->q_node
authorMing Lei <ming.lei@redhat.com>
Thu, 17 Aug 2023 14:17:51 +0000 (22:17 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 23 Aug 2023 15:32:37 +0000 (17:32 +0200)
commitcd4ffdf56791eec95af01f06bee1ec7665ca75c4
treec36bc404816b42d33a7e56e28f34d7c5c39096be
parent3c38774dbaaa7a71209cd19f839160d09b17fe48
blk-cgroup: hold queue_lock when removing blkg->q_node

commit c164c7bc9775be7bcc68754bb3431fce5823822e upstream.

When blkg is removed from q->blkg_list from blkg_free_workfn(), queue_lock
has to be held, otherwise, all kinds of bugs(list corruption, hard lockup,
..) can be triggered from blkg_destroy_all().

Fixes: f1c006f1c685 ("blk-cgroup: synchronize pd_free_fn() from blkg_free_workfn() and blkcg_deactivate_policy()")
Cc: Yu Kuai <yukuai3@huawei.com>
Cc: xiaoli feng <xifeng@redhat.com>
Cc: Chunyu Hu <chuhu@redhat.com>
Cc: Mike Snitzer <snitzer@kernel.org>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Acked-by: Tejun Heo <tj@kernel.org>
Link: https://lore.kernel.org/r/20230817141751.1128970-1-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
block/blk-cgroup.c