From: Al Viro Date: Sun, 24 Apr 2005 19:28:34 +0000 (-0700) Subject: [PATCH] mempolicy.c GFP fix X-Git-Tag: v2.6.12-rc4~255 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=01424961e621737c638e489b6a0b5e6602b02612;p=linux-2.6 [PATCH] mempolicy.c GFP fix zonelist_policy() forgot to mask non-zone bits from gfp when comparing zone number with policy_zone. ACKed-by: Andi Kleen Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- diff --git a/mm/mempolicy.c b/mm/mempolicy.c index a3b44a671c..08c41da429 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -661,7 +661,7 @@ static struct zonelist *zonelist_policy(unsigned int __nocast gfp, struct mempol case MPOL_BIND: /* Lower zones don't get a policy applied */ /* Careful: current->mems_allowed might have moved */ - if (gfp >= policy_zone) + if ((gfp & GFP_ZONEMASK) >= policy_zone) if (cpuset_zonelist_valid_mems_allowed(policy->v.zonelist)) return policy->v.zonelist; /*FALL THROUGH*/