Re: [PATCH]slub: fix bad scope checking

Previous thread: Re: [r8169] WARNING: at net/sched/sch_generic.c by Sergey Senozhatsky on Thursday, April 1, 2010 - 2:29 am. (1 message)

Next thread: [PATCH] initramfs: prevent buffer overflow when unpacking to rootfs by Aaro Koskinen on Thursday, April 1, 2010 - 2:45 am. (3 messages)
From: Zhang, Yanmin
Date: Thursday, April 1, 2010 - 2:32 am

Function init_kmem_cache_nodes is incorrect when checking upper limitation
of kmalloc_caches.

The patch against latest tip/master fixes it.

From: Zhang, Yanmin <yanmin_zhang@linux.intel.com>

---

--- linux-2.6/mm/slub.c	2010-04-01 17:01:21.091999999 +0800
+++ linux-2.6_slub/mm/slub.c	2010-04-01 17:04:34.876000010 +0800
@@ -2153,7 +2153,7 @@ static int init_kmem_cache_nodes(struct 
 	int local_node;
 
 	if (slab_state >= UP && (s < kmalloc_caches ||
-			s > kmalloc_caches + KMALLOC_CACHES))
+			s >= kmalloc_caches + KMALLOC_CACHES))
 		local_node = page_to_nid(virt_to_page(s));
 	else
 		local_node = 0;


--

From: Christoph Lameter
Date: Thursday, April 1, 2010 - 9:00 am

True.

Acked-by: Christoph Lameter <cl@linux-foundation.org>

--

From: Pekka Enberg
Date: Friday, April 2, 2010 - 12:03 am

Applied, thanks!
--

Previous thread: Re: [r8169] WARNING: at net/sched/sch_generic.c by Sergey Senozhatsky on Thursday, April 1, 2010 - 2:29 am. (1 message)

Next thread: [PATCH] initramfs: prevent buffer overflow when unpacking to rootfs by Aaro Koskinen on Thursday, April 1, 2010 - 2:45 am. (3 messages)