Commit d7dbd43f authored by Chris Mason's avatar Chris Mason Committed by Jens Axboe

blk-cgroup: properly pin the parent in blkcg_css_online

blkcg_css_online is supposed to pin the blkcg of the parent, but
397c9f46 refactored things and along the way, changed it to pin the
css instead.  This results in extra pins, and we end up leaking blkcgs
and cgroups.

Fixes: 397c9f46 ("blk-cgroup: move blkcg_{pin,unpin}_online out of line")
Signed-off-by: default avatarChris Mason <clm@fb.com>
Spotted-by: default avatarRik van Riel <riel@surriel.com>
Cc: <stable@vger.kernel.org> # v5.19+
Acked-by: default avatarJohannes Weiner <hannes@cmpxchg.org>
Link: https://lore.kernel.org/r/20221114181930.2093706-1-clm@fb.comSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent df24560d
...@@ -1213,7 +1213,7 @@ static int blkcg_css_online(struct cgroup_subsys_state *css) ...@@ -1213,7 +1213,7 @@ static int blkcg_css_online(struct cgroup_subsys_state *css)
* parent so that offline always happens towards the root. * parent so that offline always happens towards the root.
*/ */
if (parent) if (parent)
blkcg_pin_online(css); blkcg_pin_online(&parent->css);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment