Re: [PATCH 4/4] cgroup: implement task_cgroup_path_from_hierarchy()

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

 



On Sun, Apr 14, 2013 at 08:46:13PM -0700, Tejun Heo wrote:
> On Mon, Apr 15, 2013 at 11:43:15AM +0800, Li Zefan wrote:
> > > +int task_cgroup_path_from_hierarchy(struct task_struct *task, int hierarchy_id,
> > > +				    char *buf, size_t buflen)
> > > +{
> > > +	struct cgroupfs_root *root;
> > > +	struct cgroup *cgrp = NULL;
> > > +	int ret = -ENOENT;
> > > +
> > > +	mutex_lock(&cgroup_mutex);
> > > +
> > > +	root = idr_find(&cgroup_hierarchy_idr, hierarchy_id);
> > > +	if (root) {
> > > +		cgrp = task_cgroup_from_root(task, root);
> > 
> > task_cgroup_from_root() will never return NULL, and there's a BUG_ON(!res) in it.
> 
> @hierarchy_id may come from userland, so we probably should update
> task_cgroup_from_root() to return NULL if the id is invalid.  Will add
> a patch.

For some reason, I thought you were talking about hierarchy lookup.
Yeap, task_cgroup_from_root() can't be NULL for a valid hierarchy.
Will drop the if.

-- 
tejun
_______________________________________________
Containers mailing list
Containers@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linuxfoundation.org/mailman/listinfo/containers




[Index of Archives]     [Cgroups]     [Netdev]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux