[tip:x86/numa] x86-32, numa: Fix failure condition check in alloc_remap()

From: tip-bot for Tejun Heo
Date: Wed Apr 06 2011 - 22:04:15 EST


Commit-ID: 3fe14ab541cd9b0d1f243afb7556046f12c8743c
Gitweb: http://git.kernel.org/tip/3fe14ab541cd9b0d1f243afb7556046f12c8743c
Author: Tejun Heo <tj@xxxxxxxxxx>
AuthorDate: Tue, 5 Apr 2011 00:23:47 +0200
Committer: H. Peter Anvin <hpa@xxxxxxxxx>
CommitDate: Wed, 6 Apr 2011 17:56:46 -0700

x86-32, numa: Fix failure condition check in alloc_remap()

node_remap_{start|end}_vaddr[] describe [start, end) ranges; however,
alloc_remap() incorrectly failed when the current allocation + size
equaled the end but it should fail only when it goes over. Fix it.

Signed-off-by: Tejun Heo <tj@xxxxxxxxxx>
Link: http://lkml.kernel.org/r/1301955840-7246-2-git-send-email-tj@xxxxxxxxxx
Acked-by: Yinghai Lu <yinghai@xxxxxxxxxx>
Cc: David Rientjes <rientjes@xxxxxxxxxx>
Signed-off-by: H. Peter Anvin <hpa@xxxxxxxxx>
---
arch/x86/mm/numa_32.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/mm/numa_32.c b/arch/x86/mm/numa_32.c
index bde3906..84aac47 100644
--- a/arch/x86/mm/numa_32.c
+++ b/arch/x86/mm/numa_32.c
@@ -200,7 +200,7 @@ void *alloc_remap(int nid, unsigned long size)

size = ALIGN(size, L1_CACHE_BYTES);

- if (!allocation || (allocation + size) >= node_remap_end_vaddr[nid])
+ if (!allocation || (allocation + size) > node_remap_end_vaddr[nid])
return NULL;

node_remap_alloc_vaddr[nid] += size;
--
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/