Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 346309
b: refs/heads/master
c: 5e1182d
h: refs/heads/master
i:
  346307: 47e3940
v: v3
  • Loading branch information
Eric W. Biederman committed Nov 19, 2012
1 parent 5fa4917 commit 57ff284
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 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: 0a01f2cc390e10633a54f72c608cc3fe19a50c3d
refs/heads/master: 5e1182deb81ae8c68494017c4a8a71811659c870
8 changes: 7 additions & 1 deletion trunk/kernel/pid.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,10 @@ void free_pid(struct pid *pid)
for (i = 0; i <= pid->level; i++) {
struct upid *upid = pid->numbers + i;
hlist_del_rcu(&upid->pid_chain);
if (--upid->ns->nr_hashed == 0)
if (--upid->ns->nr_hashed == 0) {
upid->ns->nr_hashed = -1;
schedule_work(&upid->ns->proc_work);
}
}
spin_unlock_irqrestore(&pidmap_lock, flags);

Expand Down Expand Up @@ -321,6 +323,8 @@ struct pid *alloc_pid(struct pid_namespace *ns)

upid = pid->numbers + ns->level;
spin_lock_irq(&pidmap_lock);
if (ns->nr_hashed < 0)
goto out_unlock;
for ( ; upid >= pid->numbers; --upid) {
hlist_add_head_rcu(&upid->pid_chain,
&pid_hash[pid_hashfn(upid->nr, upid->ns)]);
Expand All @@ -331,6 +335,8 @@ struct pid *alloc_pid(struct pid_namespace *ns)
out:
return pid;

out_unlock:
spin_unlock(&pidmap_lock);
out_free:
while (++i <= ns->level)
free_pidmap(pid->numbers + i);
Expand Down

0 comments on commit 57ff284

Please sign in to comment.