diff options
Diffstat (limited to 'kernel/cpuset.c')
-rw-r--r-- | kernel/cpuset.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 6313c38c930e..bd1e89c4c96a 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c | |||
@@ -729,9 +729,11 @@ static int validate_change(const struct cpuset *cur, const struct cpuset *trial) | |||
729 | } | 729 | } |
730 | 730 | ||
731 | /* Remaining checks don't apply to root cpuset */ | 731 | /* Remaining checks don't apply to root cpuset */ |
732 | if ((par = cur->parent) == NULL) | 732 | if (cur == &top_cpuset) |
733 | return 0; | 733 | return 0; |
734 | 734 | ||
735 | par = cur->parent; | ||
736 | |||
735 | /* We must be a subset of our parent cpuset */ | 737 | /* We must be a subset of our parent cpuset */ |
736 | if (!is_cpuset_subset(trial, par)) | 738 | if (!is_cpuset_subset(trial, par)) |
737 | return -EACCES; | 739 | return -EACCES; |
@@ -1060,10 +1062,7 @@ static int update_flag(cpuset_flagbits_t bit, struct cpuset *cs, char *buf) | |||
1060 | cpu_exclusive_changed = | 1062 | cpu_exclusive_changed = |
1061 | (is_cpu_exclusive(cs) != is_cpu_exclusive(&trialcs)); | 1063 | (is_cpu_exclusive(cs) != is_cpu_exclusive(&trialcs)); |
1062 | mutex_lock(&callback_mutex); | 1064 | mutex_lock(&callback_mutex); |
1063 | if (turning_on) | 1065 | cs->flags = trialcs.flags; |
1064 | set_bit(bit, &cs->flags); | ||
1065 | else | ||
1066 | clear_bit(bit, &cs->flags); | ||
1067 | mutex_unlock(&callback_mutex); | 1066 | mutex_unlock(&callback_mutex); |
1068 | 1067 | ||
1069 | if (cpu_exclusive_changed) | 1068 | if (cpu_exclusive_changed) |