Re: [patch 3/4] mempolicy: add MPOL_F_STATIC_NODES flag

From: David Rientjes
Date: Fri Feb 15 2008 - 15:33:24 EST


On Fri, 15 Feb 2008, David Rientjes wrote:

> It would be possible to do all of this in both sys_set_mempolicy() and
> sys_mbind() by masking off the set of possible modes and checking the
> result for being >= MPOL_MAX:
>
> if ((mode & MPOL_MODE_FLAGS) >= MPOL_MAX)
> return -EINVAL;

Actually, in sys_setmempolicy() or sys_mbind() where mode is an int:

unsigned short flags;

flags = mode & MPOL_MODE_FLAGS;
mode &= ~MPOL_MODE_FLAGS;
if (mode < 0 || mode >= MPOL_MAX)
return -EINVAL;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/