diff options
-rw-r--r-- | mm/mempolicy.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 6196505a1119..77d6f750af3c 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -1410,10 +1410,14 @@ SYSCALL_DEFINE4(migrate_pages, pid_t, pid, unsigned long, maxnode, goto out_put; } - if (!nodes_subset(*new, node_states[N_MEMORY])) { - err = -EINVAL; + task_nodes = cpuset_mems_allowed(current); + nodes_and(*new, *new, task_nodes); + if (nodes_empty(*new)) + goto out_put; + + nodes_and(*new, *new, node_states[N_MEMORY]); + if (nodes_empty(*new)) goto out_put; - } err = security_task_movememory(task); if (err) |