mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-27 21:03:32 +00:00
blk-cgroup: hold queue_lock when removing blkg->q_node
commitc164c7bc97
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:f1c006f1c6
("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>
This commit is contained in:
parent
3c38774dba
commit
cd4ffdf567
1 changed files with 2 additions and 0 deletions
|
@ -136,7 +136,9 @@ static void blkg_free_workfn(struct work_struct *work)
|
|||
blkcg_policy[i]->pd_free_fn(blkg->pd[i]);
|
||||
if (blkg->parent)
|
||||
blkg_put(blkg->parent);
|
||||
spin_lock_irq(&q->queue_lock);
|
||||
list_del_init(&blkg->q_node);
|
||||
spin_unlock_irq(&q->queue_lock);
|
||||
mutex_unlock(&q->blkcg_mutex);
|
||||
|
||||
blk_put_queue(q);
|
||||
|
|
Loading…
Reference in a new issue