From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-f194.google.com ([209.85.215.194]:37944 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726321AbeL3Tle (ORCPT ); Sun, 30 Dec 2018 14:41:34 -0500 Date: Sun, 30 Dec 2018 11:41:29 -0800 From: Andrei Vagin To: Alexander Viro , David Howells Cc: linux-fsdevel@vger.kernel.org, cgroups@vger.kernel.org, Li Zefan Subject: Re: [PATCH vfs/for-next v2] cgroup: fix top cgroup refcnt leak Message-ID: <20181230194128.GA2507@gmail.com> References: <20181228235900.21468-1-avagin@gmail.com> <20181229000400.26333-1-avagin@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20181229000400.26333-1-avagin@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Alexander and David, This patch fixed the problem which was reported more than a mounth ago https://patchwork.kernel.org/patch/10610671/ Now this code is in the linux-next and the problem blocks running CRIU tests on the linux next kernels: https://travis-ci.org/avagin/linux/builds Thanks, Andrei On Fri, Dec 28, 2018 at 04:04:00PM -0800, Andrei Vagin wrote: > It looks like the c6b3d5bcd67c ("cgroup: fix top cgroup refcnt leak") > commit was reverted by mistake. > > $ mkdir /tmp/cgroup > $ mkdir /tmp/cgroup2 > $ mount -t cgroup -o none,name=test test /tmp/cgroup > $ mount -t cgroup -o none,name=test test /tmp/cgroup2 > $ umount /tmp/cgroup > $ umount /tmp/cgroup2 > $ cat /proc/self/cgroup | grep test > 12:name=test:/ > > You can see the test cgroup was not freed. > > Cc: Li Zefan > Fixes: aea3f2676c83 ("kernfs, sysfs, cgroup, intel_rdt: Support fs_context") > Signed-off-by: Andrei Vagin > --- > > v2: clean up code and add the vfs/for-next tag > > kernel/cgroup/cgroup.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c > index fb0717696895..f63974a3725f 100644 > --- a/kernel/cgroup/cgroup.c > +++ b/kernel/cgroup/cgroup.c > @@ -2047,6 +2047,9 @@ int cgroup_do_get_tree(struct fs_context *fc) > ret = 0; > if (ctx->kfc.new_sb_created) > goto out_cgrp; > + else > + cgroup_put(&ctx->root->cgrp); > + > apply_cgroup_root_flags(ctx->flags); > return 0; > > -- > 2.17.2 >