Memoryless nodes: Fix interleave behavior for memoryless nodes
[linux-2.6.git] / mm / mempolicy.c
index ccbdb22147bb9ca16b6c4728e006c884a951a40e..5daf63bd97e7f36e6620641cc86fda3b5eeaab35 100644 (file)
@@ -183,7 +183,9 @@ static struct mempolicy *mpol_new(int mode, nodemask_t *nodes)
        switch (mode) {
        case MPOL_INTERLEAVE:
                policy->v.nodes = *nodes;
-               if (nodes_weight(*nodes) == 0) {
+               nodes_and(policy->v.nodes, policy->v.nodes,
+                                       node_states[N_HIGH_MEMORY]);
+               if (nodes_weight(policy->v.nodes) == 0) {
                        kmem_cache_free(policy_cache, policy);
                        return ERR_PTR(-EINVAL);
                }