]> git.baikalelectronics.ru Git - kernel.git/commit
blkcg: fix blkg_alloc() failure path
authorTejun Heo <tj@kernel.org>
Mon, 4 Jun 2012 06:21:00 +0000 (15:21 +0900)
committerJens Axboe <axboe@kernel.dk>
Mon, 4 Jun 2012 08:03:21 +0000 (10:03 +0200)
commit7067a1ed51d63cfdfe1782e691cb3d9d5a50b6ef
tree8bb42b9a25bd723fe838cc6a4fa3b077a02e50b4
parent8040c14daf47269931340b2bcb2df5e5eddb62d6
blkcg: fix blkg_alloc() failure path

When policy data allocation fails in the middle, blkg_alloc() invokes
blkg_free() to destroy the half constructed blkg.  This ends up
calling pd_exit_fn() on policy datas which didn't go through
pd_init_fn().  Fix it by making blkg_alloc() call pd_init_fn()
immediately after each policy data allocation.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-cgroup.c