Re: [16/32] kernfs, sysfs, cgroup, intel_rdt: Support fs_context [ver #8]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Andrei Vagin <avagin@xxxxxxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe cgroups" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [Monitors]

  Powered by Linux