summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Mason <clm@fb.com>2022-11-14 21:19:30 +0300
committerJens Axboe <axboe@kernel.dk>2022-11-14 22:13:19 +0300
commitd7dbd43f4a828fa1d9a8614d5b0ac40aee6375fe (patch)
tree4b8e162690d66fc78dff1a3e431b8751db663c1a
parentdf24560d058d11f02b7493bdfc553131ef60b23d (diff)
downloadlinux-d7dbd43f4a828fa1d9a8614d5b0ac40aee6375fe.tar.xz
blk-cgroup: properly pin the parent in blkcg_css_online
blkcg_css_online is supposed to pin the blkcg of the parent, but 397c9f46ee4d 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: 397c9f46ee4d ("blk-cgroup: move blkcg_{pin,unpin}_online out of line") Signed-off-by: Chris Mason <clm@fb.com> Spotted-by: Rik van Riel <riel@surriel.com> Cc: <stable@vger.kernel.org> # v5.19+ Acked-by: Johannes Weiner <hannes@cmpxchg.org> Link: https://lore.kernel.org/r/20221114181930.2093706-1-clm@fb.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--block/blk-cgroup.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index 6a5c849ee061..ed761c62ad0a 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -1213,7 +1213,7 @@ static int blkcg_css_online(struct cgroup_subsys_state *css)
* parent so that offline always happens towards the root.
*/
if (parent)
- blkcg_pin_online(css);
+ blkcg_pin_online(&parent->css);
return 0;
}