blk-cgroup: improve error unwinding in blkg_alloc
authorChristoph Hellwig <hch@lst.de>
Fri, 3 Feb 2023 15:03:44 +0000 (16:03 +0100)
committerJens Axboe <axboe@kernel.dk>
Fri, 3 Feb 2023 15:20:04 +0000 (08:20 -0700)
commit0b6f93bdf07e52620f725f721e547408e0d04c9d
treef3af6f21fa7ef66764f8fb9d9d69ecdf42bef90a
parent178fa7d49815ea8001f43ade37a22072829fd8ab
blk-cgroup: improve error unwinding in blkg_alloc

Unwind only the previous initialization steps that happened in blkg_alloc
using goto based unwinding.  This avoids the need for the !queue special
case in blkg_free and thus ensures that any blkg seens outside of
blkg_alloc is always fully constructed.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Tejun Heo <tj@kernel.org>
Link: https://lore.kernel.org/r/20230203150400.3199230-4-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-cgroup.c