diff options
Diffstat (limited to 'mm/hugetlb.c')
| -rw-r--r-- | mm/hugetlb.c | 9 | 
1 files changed, 6 insertions, 3 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 3a5aeb37c11..4c9e6bbf377 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -2,7 +2,6 @@   * Generic hugetlb support.   * (C) William Irwin, April 2004   */ -#include <linux/gfp.h>  #include <linux/list.h>  #include <linux/init.h>  #include <linux/module.h> @@ -18,6 +17,7 @@  #include <linux/mutex.h>  #include <linux/bootmem.h>  #include <linux/sysfs.h> +#include <linux/slab.h>  #include <asm/page.h>  #include <asm/pgtable.h> @@ -546,6 +546,7 @@ static void free_huge_page(struct page *page)  	mapping = (struct address_space *) page_private(page);  	set_page_private(page, 0); +	page->mapping = NULL;  	BUG_ON(page_count(page));  	INIT_LIST_HEAD(&page->lru); @@ -1038,7 +1039,7 @@ static struct page *alloc_huge_page(struct vm_area_struct *vma,  		page = alloc_buddy_huge_page(h, vma, addr);  		if (!page) {  			hugetlb_put_quota(inode->i_mapping, chg); -			return ERR_PTR(-VM_FAULT_OOM); +			return ERR_PTR(-VM_FAULT_SIGBUS);  		}  	} @@ -2447,8 +2448,10 @@ retry:  			spin_lock(&inode->i_lock);  			inode->i_blocks += blocks_per_huge_page(h);  			spin_unlock(&inode->i_lock); -		} else +		} else {  			lock_page(page); +			page->mapping = HUGETLB_POISON; +		}  	}  	/*  |