Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S265902AbUFVVCx (ORCPT ); Tue, 22 Jun 2004 17:02:53 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S266016AbUFVVCu (ORCPT ); Tue, 22 Jun 2004 17:02:50 -0400 Received: from fmr03.intel.com ([143.183.121.5]:13472 "EHLO hermes.sc.intel.com") by vger.kernel.org with ESMTP id S265900AbUFVVBs (ORCPT ); Tue, 22 Jun 2004 17:01:48 -0400 Message-Id: <200406222100.i5ML0TY32225@unix-os.sc.intel.com> From: "Chen, Kenneth W" To: Subject: Bug fix in mm/hugetlb.c - use safe iterater Date: Tue, 22 Jun 2004 14:01:45 -0700 X-Mailer: Microsoft Office Outlook, Build 11.0.5510 Thread-Index: AcRYnCAzAMaAtxsgT1iqPqQq1PnuSg== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1030 Lines: 28 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 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/