From: David Gibson <david@gibson.dropbear.id.au>

Currently the hugepage code stores the hugepage destructor in the mapping
field of the second of the compound pages.  However, this field is never
cleared again, which causes tracebacks from free_pages_check() if the
hugepage is later destroyed by reducing the number in
/proc/sys/vm/nr_hugepages.  This patch fixes the bug by clearing the
mapping field when the hugepage is freed.

Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/mm/hugetlb.c |    1 +
 1 files changed, 1 insertion(+)

diff -puN mm/hugetlb.c~hugetlb-dtor-reinit mm/hugetlb.c
--- 25/mm/hugetlb.c~hugetlb-dtor-reinit	Wed Jun  2 14:31:02 2004
+++ 25-akpm/mm/hugetlb.c	Wed Jun  2 14:31:02 2004
@@ -57,6 +57,7 @@ void free_huge_page(struct page *page)
 	BUG_ON(page_count(page));
 
 	INIT_LIST_HEAD(&page->lru);
+	page[1].mapping = NULL;
 
 	spin_lock(&hugetlb_lock);
 	enqueue_huge_page(page);
_