From: Paul Menage Fix a reference counting bug in cgroupfs As part of the extraction of cpusetfs to cgroupfs, a call to cpuset_get_dentry() was lost (justified by the fact that the dentry in question was now being passed down by the caller). Since cpuset_get_dentry() called lookup_one_len(), this resulted in a reference count being missed from the directory dentry. This patch removes cgroup_get_dentry() and replaces it with direct calls to lookup_one_len(); the initialization of cgroupfs dentry ops is done now in cgroup_create_file() at dentry creation time. Signed-off-by: Paul Menage Signed-off-by: Andrew Morton --- kernel/cgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -puN kernel/cgroup.c~task-cgroupsv11-add-cgroup_clone-interface-cgroups-fix-refcount-bug kernel/cgroup.c --- a/kernel/cgroup.c~task-cgroupsv11-add-cgroup_clone-interface-cgroups-fix-refcount-bug +++ a/kernel/cgroup.c @@ -1722,7 +1722,7 @@ int cgroup_clone(struct task_struct * /* Hold the parent directory mutex across this operation to * stop anyone else deleting the new cgroup */ mutex_lock(&inode->i_mutex); - dentry = cgroup_get_dentry(parent->dentry, nodename); + dentry = lookup_one_len(nodename, parent->dentry, strlen(nodename)); if (IS_ERR(dentry)) { printk(KERN_INFO "Couldn't allocate dentry for %s: %ld\n", nodename, _