[PATCH] mempolicy.c GFP fix
authorAl Viro <viro@www.linux.org.uk>
Sun, 24 Apr 2005 19:28:34 +0000 (12:28 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Sun, 24 Apr 2005 19:28:34 +0000 (12:28 -0700)
zonelist_policy() forgot to mask non-zone bits from gfp when comparing
zone number with policy_zone.

ACKed-by: Andi Kleen <ak@suse.de>
Signed-off-by: Al Viro <viro@parcelfarce.linux.theplanet.co.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
mm/mempolicy.c

index a3b44a671cec23f04d570275090036e40cb1ae20..08c41da429cf015e9c22443ae5d811d4f5fa3569 100644 (file)
@@ -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 */
        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*/
                        if (cpuset_zonelist_valid_mems_allowed(policy->v.zonelist))
                                return policy->v.zonelist;
                /*FALL THROUGH*/