Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 127611
b: refs/heads/master
c: 5771f0a
h: refs/heads/master
i:
  127609: 586a995
  127607: 48e20e4
v: v3
  • Loading branch information
Li Zefan authored and Linus Torvalds committed Jan 8, 2009
1 parent 4b886f3 commit 357f6f9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 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: 5a7625df725a486ad600b0036b6111dbd6321c41
refs/heads/master: 5771f0a2236df69683e9abea87f35f522c97ff94
11 changes: 5 additions & 6 deletions trunk/kernel/cpuset.c
Original file line number Diff line number Diff line change
Expand Up @@ -1311,20 +1311,19 @@ static int cpuset_can_attach(struct cgroup_subsys *ss,
struct cgroup *cont, struct task_struct *tsk)
{
struct cpuset *cs = cgroup_cs(cont);
int ret = 0;

if (cpus_empty(cs->cpus_allowed) || nodes_empty(cs->mems_allowed))
return -ENOSPC;
if (tsk->flags & PF_THREAD_BOUND) {
cpumask_t mask;

if (tsk->flags & PF_THREAD_BOUND) {
mutex_lock(&callback_mutex);
mask = cs->cpus_allowed;
if (!cpus_equal(tsk->cpus_allowed, cs->cpus_allowed))
ret = -EINVAL;
mutex_unlock(&callback_mutex);
if (!cpus_equal(tsk->cpus_allowed, mask))
return -EINVAL;
}

return security_task_setscheduler(tsk, 0, NULL);
return ret < 0 ? ret : security_task_setscheduler(tsk, 0, NULL);
}

static void cpuset_attach(struct cgroup_subsys *ss,
Expand Down

0 comments on commit 357f6f9

Please sign in to comment.