From: Rusty Russell Subject: Re: [PATCH] Trivial fix for latent bug in page_alloc.c Date: Tue, 08 Feb 2005 13:32:26 +1100 Message-ID: <1107829946.19407.18.camel@localhost.localdomain> References: <1106106821.20879.14.camel@localhost.localdomain> <41EE8EBE.2080900@blueyonder.co.uk> <1107317570.10400.38.camel@localhost.localdomain> <420162C0.9000404@blueyonder.co.uk> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit In-Reply-To: <420162C0.9000404@blueyonder.co.uk> Sender: xen-devel-admin@lists.sourceforge.net Errors-To: xen-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: david.nospam.hopwood@blueyonder.co.uk Cc: Xen Mailing List List-Id: xen-devel@lists.xenproject.org On Wed, 2005-02-02 at 23:31 +0000, David Hopwood wrote: > Rusty Russell wrote: > >>>@@ -251,17 +249,18 @@ > >>> int i; > >>> struct pfn_info *pg; > >>> > >>>- if ( unlikely(order < MIN_ORDER) || unlikely(order > MAX_ORDER) ) > >>>+ ASSERT(order >= 0); > >>>+ if ( unlikely(order >= MAX_ORDER) ) > >>> return NULL; > >> > [...] > >>Also changing > to >= is wrong. > > > > Well, it's consistent with the rest of the patch. > > How so? 'order == MAX_ORDER' is possible and valid, unless MAX_ORDER is > misnamed. Yes, I erred badly in not using NR_ORDERS, which lead to this conversation. Nomenclature is important, and I made a hash of it in this patch. Fortunately, greater minds such as yours spat it out 8) Thanks, Rusty. -- A bad analogy is like a leaky screwdriver -- Richard Braakman ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click