diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/cpuset.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c index f513dd937eee..3ea63da11d71 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c | |||
@@ -799,18 +799,23 @@ static int update_nodemask(struct cpuset *cs, char *buf) | |||
799 | trialcs = *cs; | 799 | trialcs = *cs; |
800 | retval = nodelist_parse(buf, trialcs.mems_allowed); | 800 | retval = nodelist_parse(buf, trialcs.mems_allowed); |
801 | if (retval < 0) | 801 | if (retval < 0) |
802 | return retval; | 802 | goto done; |
803 | nodes_and(trialcs.mems_allowed, trialcs.mems_allowed, node_online_map); | 803 | nodes_and(trialcs.mems_allowed, trialcs.mems_allowed, node_online_map); |
804 | if (nodes_empty(trialcs.mems_allowed)) | 804 | if (nodes_empty(trialcs.mems_allowed)) { |
805 | return -ENOSPC; | 805 | retval = -ENOSPC; |
806 | retval = validate_change(cs, &trialcs); | 806 | goto done; |
807 | if (retval == 0) { | ||
808 | down(&callback_sem); | ||
809 | cs->mems_allowed = trialcs.mems_allowed; | ||
810 | atomic_inc(&cpuset_mems_generation); | ||
811 | cs->mems_generation = atomic_read(&cpuset_mems_generation); | ||
812 | up(&callback_sem); | ||
813 | } | 807 | } |
808 | retval = validate_change(cs, &trialcs); | ||
809 | if (retval < 0) | ||
810 | goto done; | ||
811 | |||
812 | down(&callback_sem); | ||
813 | cs->mems_allowed = trialcs.mems_allowed; | ||
814 | atomic_inc(&cpuset_mems_generation); | ||
815 | cs->mems_generation = atomic_read(&cpuset_mems_generation); | ||
816 | up(&callback_sem); | ||
817 | |||
818 | done: | ||
814 | return retval; | 819 | return retval; |
815 | } | 820 | } |
816 | 821 | ||