From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-f194.google.com ([209.85.210.194]:42059 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726116AbeL2ABR (ORCPT ); Fri, 28 Dec 2018 19:01:17 -0500 Date: Fri, 28 Dec 2018 16:01:14 -0800 From: Andrei Vagin To: Alexander Viro , David Howells Cc: linux-fsdevel@vger.kernel.org, cgroups@vger.kernel.org Subject: Re: [PATCH vfs/for-next] cgroup: fix cgroup refcnt leak Message-ID: <20181229000113.GB9034@gmail.com> References: <20181227181721.24488-1-avagin@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20181227181721.24488-1-avagin@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Pls, ignore this patch. On Thu, Dec 27, 2018 at 10:17:21AM -0800, Andrei Vagin wrote: > Currently, we get refcnt twice if a new root isn't created. > > percpu_ref_tryget_live() is called and then cgroup_get() is called too. > > Fixes: aea3f2676c83 ("kernfs, sysfs, cgroup, intel_rdt: Support fs_context") > Signed-off-by: Andrei Vagin > --- > kernel/cgroup/cgroup-v1.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/cgroup/cgroup-v1.c b/kernel/cgroup/cgroup-v1.c > index d5ae888b8c57..5ae9b3db8bfd 100644 > --- a/kernel/cgroup/cgroup-v1.c > +++ b/kernel/cgroup/cgroup-v1.c > @@ -1280,8 +1280,8 @@ int cgroup1_get_tree(struct fs_context *fc) > mutex_lock(&cgroup_mutex); > percpu_ref_reinit(&root->cgrp.self.refcnt); > mutex_unlock(&cgroup_mutex); > + cgroup_get(&root->cgrp); > } > - cgroup_get(&root->cgrp); > > /* > * If @pinned_sb, we're reusing an existing root and holding an > -- > 2.17.2 >