]> git.baikalelectronics.ru Git - kernel.git/commit
blkcg: init root blkcg_gq under lock
authorJiang Biao <jiang.biao2@zte.com.cn>
Thu, 19 Apr 2018 04:06:09 +0000 (12:06 +0800)
committerJens Axboe <axboe@kernel.dk>
Thu, 19 Apr 2018 14:51:59 +0000 (08:51 -0600)
commit2a829276c6116a0484b5118e27cf477031258a4e
tree164d6ced670758d58973b555dc54126a88d17773
parent4d3ae82af15c0966bbd1b115e35ace7403635a82
blkcg: init root blkcg_gq under lock

The initializing of q->root_blkg is currently outside of queue lock
and rcu, so the blkg may be destroied before the initializing, which
may cause dangling/null references. On the other side, the destroys
of blkg are protected by queue lock or rcu. Put the initializing
inside the queue lock and rcu to make it safer.

Signed-off-by: Jiang Biao <jiang.biao2@zte.com.cn>
Signed-off-by: Wen Yang <wen.yang99@zte.com.cn>
CC: Tejun Heo <tj@kernel.org>
CC: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-cgroup.c