Bug fix in mm/hugetlb.c - use safe iterater

From: Chen, Kenneth W
Date: Tue Jun 22 2004 - 16:07:25 EST


With list poisoning on by default from linux-2.6.7, it's easier
than ever to trigger the bug in try_to_free_low(). It ought to
use the safe version of list iterater.

Signed-off-by: Ken Chen <kenneth.w.chen@xxxxxxxxx>


diff -Nurp linux-2.6.7.orig/mm/hugetlb.c linux-2.6.7/mm/hugetlb.c
--- linux-2.6.7.orig/mm/hugetlb.c 2004-06-15 22:19:37.000000000 -0700
+++ linux-2.6.7/mm/hugetlb.c 2004-06-22 13:45:11.000000000 -0700
@@ -134,8 +134,8 @@ static int try_to_free_low(unsigned long
{
int i;
for (i = 0; i < MAX_NUMNODES; ++i) {
- struct page *page;
- list_for_each_entry(page, &hugepage_freelists[i], lru) {
+ struct page *page, *next;
+ list_for_each_entry_safe(page, next, &hugepage_freelists[i], lru) {
if (PageHighMem(page))
continue;
list_del(&page->lru);


-
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/