Return-Path: Received: from mx1.redhat.com ([209.132.183.28]:49500 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725985AbfACA00 (ORCPT ); Wed, 2 Jan 2019 19:26:26 -0500 From: David Howells In-Reply-To: <20190102210659.3125-1-avagin@gmail.com> References: <20190102210659.3125-1-avagin@gmail.com> <20190102200223.GI2217@ZenIV.linux.org.uk> To: Andrei Vagin Cc: dhowells@redhat.com, Alexander Viro , linux-fsdevel@vger.kernel.org, cgroups@vger.kernel.org, Li Zefan Subject: Re: [PATCH vfs/for-next v4] cgroup: fix top cgroup refcnt leak MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <8616.1546475183.1@warthog.procyon.org.uk> Date: Thu, 03 Jan 2019 00:26:23 +0000 Message-ID: <8617.1546475183@warthog.procyon.org.uk> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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 > v3: fix a reference leak when kernfs_node_dentry fails > v4: call deactivate_locked_super() in a error case > v5: don't dereference fc->root after dput() > > kernel/cgroup/cgroup.c | 25 ++++++++++++++++++------- > 1 file changed, 18 insertions(+), 7 deletions(-) This patch doesn't work either. percpu ref (css_release) <= 0 (0) after switching to atomic RIP: 0010:percpu_ref_switch_to_atomic_rcu+0x90/0x1a0 Btw, note that the subject says "v4" but the changelog says "v5". David