Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 187211
b: refs/heads/master
c: b70cc5f
h: refs/heads/master
i:
  187209: fa1e2af
  187207: ab0468a
v: v3
  • Loading branch information
Li Zefan authored and Linus Torvalds committed Mar 12, 2010
1 parent df7bcfb commit 8c53420
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 67523c48aa74d5637848edeccf285af1c60bf14a
refs/heads/master: b70cc5fdb445a6929a01e9c406593265b136c99d
8 changes: 3 additions & 5 deletions trunk/kernel/cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -2597,7 +2597,8 @@ static struct cgroup_pidlist *cgroup_pidlist_find(struct cgroup *cgrp,
{
struct cgroup_pidlist *l;
/* don't need task_nsproxy() if we're looking at ourself */
struct pid_namespace *ns = get_pid_ns(current->nsproxy->pid_ns);
struct pid_namespace *ns = current->nsproxy->pid_ns;

/*
* We can't drop the pidlist_mutex before taking the l->mutex in case
* the last ref-holder is trying to remove l from the list at the same
Expand All @@ -2607,8 +2608,6 @@ static struct cgroup_pidlist *cgroup_pidlist_find(struct cgroup *cgrp,
mutex_lock(&cgrp->pidlist_mutex);
list_for_each_entry(l, &cgrp->pidlists, links) {
if (l->key.type == type && l->key.ns == ns) {
/* found a matching list - drop the extra refcount */
put_pid_ns(ns);
/* make sure l doesn't vanish out from under us */
down_write(&l->mutex);
mutex_unlock(&cgrp->pidlist_mutex);
Expand All @@ -2619,13 +2618,12 @@ static struct cgroup_pidlist *cgroup_pidlist_find(struct cgroup *cgrp,
l = kmalloc(sizeof(struct cgroup_pidlist), GFP_KERNEL);
if (!l) {
mutex_unlock(&cgrp->pidlist_mutex);
put_pid_ns(ns);
return l;
}
init_rwsem(&l->mutex);
down_write(&l->mutex);
l->key.type = type;
l->key.ns = ns;
l->key.ns = get_pid_ns(ns);
l->use_count = 0; /* don't increment here */
l->list = NULL;
l->owner = cgrp;
Expand Down

0 comments on commit 8c53420

Please sign in to comment.