lkml.org 
[lkml]   [2018]   [Jun]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [16/32] kernfs, sysfs, cgroup, intel_rdt: Support fs_context [ver #8]
On Fri, Jun 22, 2018 at 08:30:29AM -0700, Andrei Vagin wrote:
> On Fri, Jun 22, 2018 at 01:52:16PM +0100, David Howells wrote:
> > Andrei Vagin <avagin@virtuozzo.com> wrote:
> >
> > > ret = 0;
> > > + ctx->root = root;
> > > goto out_unlock;
> >
> > Okay, I can see that.
> >
> > > percpu_ref_reinit(&root->cgrp.self.refcnt);
> > > mutex_unlock(&cgroup_mutex);
> > > }
> > > + cgroup_get(&root->cgrp);
> >
> > This probably needs to be conditional on ret == 0.
>
> yes, you are right


I've read the code and I think it isn't obvious. A reference will be
released id cgroup_fs_context_free() even if ret isn't zero here.

I look at do_new_mount()

vfs_new_fs_context()
...
if (vfs_get_tree())
goto out_fc;
....
out_fc:
put_fs_context(fc);
fc->ops->free(fc);
cgroup_fs_context_free()
cgroup_put(&ctx->root->cgrp);

>
> >
> > Which version are you testing btw? The patches in git have been fixed a
> > little from what was last posted.
>
> I'm testing linux-next-20180621
>
> commit 8439c34f07a3f58245e933ca2703239417288363 (tag: next-20180621,
> linux-next/master)
> Author: Stephen Rothwell <sfr@canb.auug.org.au>
> Date: Thu Jun 21 14:09:41 2018 +1000
>
> Add linux-next specific files for 20180621
>
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
>
> >
> > David

\
 
 \ /
  Last update: 2018-06-22 18:58    [W:0.100 / U:0.760 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site