* [PATCH] blk-cgroup: properly pin the parent in blkcg_css_online
@ 2022-11-14 18:19 Chris Mason
2022-11-14 19:00 ` Johannes Weiner
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Chris Mason @ 2022-11-14 18:19 UTC (permalink / raw)
To: hch, axboe, linux-block, tj, riel, hannes
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+
---
block/blk-cgroup.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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;
}
--
2.30.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] blk-cgroup: properly pin the parent in blkcg_css_online
2022-11-14 18:19 [PATCH] blk-cgroup: properly pin the parent in blkcg_css_online Chris Mason
@ 2022-11-14 19:00 ` Johannes Weiner
2022-11-14 19:13 ` Jens Axboe
2022-11-15 7:57 ` Christoph Hellwig
2 siblings, 0 replies; 4+ messages in thread
From: Johannes Weiner @ 2022-11-14 19:00 UTC (permalink / raw)
To: Chris Mason; +Cc: hch, axboe, linux-block, tj, riel
On Mon, Nov 14, 2022 at 10:19:30AM -0800, Chris Mason wrote:
> 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>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] blk-cgroup: properly pin the parent in blkcg_css_online
2022-11-14 18:19 [PATCH] blk-cgroup: properly pin the parent in blkcg_css_online Chris Mason
2022-11-14 19:00 ` Johannes Weiner
@ 2022-11-14 19:13 ` Jens Axboe
2022-11-15 7:57 ` Christoph Hellwig
2 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2022-11-14 19:13 UTC (permalink / raw)
To: hannes, Chris Mason, tj, riel, hch, linux-block
On Mon, 14 Nov 2022 10:19:30 -0800, Chris Mason wrote:
> 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.
>
>
Applied, thanks!
[1/1] blk-cgroup: properly pin the parent in blkcg_css_online
commit: d7dbd43f4a828fa1d9a8614d5b0ac40aee6375fe
Best regards,
--
Jens Axboe
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] blk-cgroup: properly pin the parent in blkcg_css_online
2022-11-14 18:19 [PATCH] blk-cgroup: properly pin the parent in blkcg_css_online Chris Mason
2022-11-14 19:00 ` Johannes Weiner
2022-11-14 19:13 ` Jens Axboe
@ 2022-11-15 7:57 ` Christoph Hellwig
2 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2022-11-15 7:57 UTC (permalink / raw)
To: Chris Mason; +Cc: hch, axboe, linux-block, tj, riel, hannes
Looks good:
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-11-15 7:58 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-14 18:19 [PATCH] blk-cgroup: properly pin the parent in blkcg_css_online Chris Mason
2022-11-14 19:00 ` Johannes Weiner
2022-11-14 19:13 ` Jens Axboe
2022-11-15 7:57 ` Christoph Hellwig
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.