Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762949AbYBOUdW (ORCPT ); Fri, 15 Feb 2008 15:33:22 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755017AbYBOUdJ (ORCPT ); Fri, 15 Feb 2008 15:33:09 -0500 Received: from smtp-out.google.com ([216.239.33.17]:60671 "EHLO smtp-out.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755049AbYBOUdI (ORCPT ); Fri, 15 Feb 2008 15:33:08 -0500 DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=received:date:from:x-x-sender:to:cc:subject:in-reply-to: message-id:references:user-agent:mime-version:content-type; b=ekJHyjP25OElP5n3/60Mw96vjaMNwo0+VIBkXKdHlMDo/wpE2hAz+dRD4bgCXbk0u SLTTZeJIqWkm7a8XjD8LA== Date: Fri, 15 Feb 2008 12:32:25 -0800 (PST) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Paul Jackson cc: akpm@linux-foundation.org, clameter@sgi.com, Lee.Schermerhorn@hp.com, ak@suse.de, linux-kernel@vger.kernel.org Subject: Re: [patch 3/4] mempolicy: add MPOL_F_STATIC_NODES flag In-Reply-To: Message-ID: References: <20080214040918.d735e920.pj@sgi.com> <20080215032748.8b07e5eb.pj@sgi.com> User-Agent: Alpine 1.00 (DEB 882 2007-12-20) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 744 Lines: 22 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/