[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <16505.1529796876@warthog.procyon.org.uk>
Date: Sun, 24 Jun 2018 00:34:36 +0100
From: David Howells <dhowells@...hat.com>
To: Andrei Vagin <avagin@...tuozzo.com>
Cc: dhowells@...hat.com, viro@...iv.linux.org.uk,
linux-fsdevel@...r.kernel.org, linux-afs@...ts.infradead.org,
linux-kernel@...r.kernel.org, cgroups@...r.kernel.org,
Tejun Heo <tj@...nel.org>
Subject: Re: [16/32] kernfs, sysfs, cgroup, intel_rdt: Support fs_context [ver #8]
Andrei Vagin <avagin@...tuozzo.com> wrote:
> > > > 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);
Yeah, you're right: ctx->root is set above, so the put will trigger anyway.
I'll fold both of these changes in.
David
Powered by blists - more mailing lists