summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorTao Cui <cuitao@kylinos.cn>2026-07-15 21:24:07 +0800
committerJens Axboe <axboe@kernel.dk>2026-07-15 16:31:43 -0600
commitdbbca20764382b4d411ec2918f4e278ffe547acc (patch)
tree75bf75431aa203c7ec16c213accf0f39c4f5fcdd /scripts
parentc4f4c0fc551cbcdccbbbc2d874d7d6440c7b4983 (diff)
blk-cgroup: fix leaks and online flag on radix_tree_insert failure
When radix_tree_insert() fails in blkg_create(), the error path has two issues: 1. blkg->online is set to true unconditionally, even when the blkg was never fully inserted. Move the assignment inside the success block. 2. The error path calls blkg_put() without first calling percpu_ref_kill(). Because the refcount is still in percpu mode, percpu_ref_put() only does this_cpu_sub() without checking for zero, so blkg_release() is never triggered. This permanently leaks the blkg memory, its percpu iostat, policy data, the parent blkg reference, and the cgroup css reference — the latter preventing the cgroup from ever being destroyed. Fix by replacing blkg_put() with percpu_ref_kill(), matching the pattern used in blkg_destroy(). Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Tao Cui <cuitao@kylinos.cn> Link: https://patch.msgid.link/20260715132407.1469777-1-cui.tao@linux.dev Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions