]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - kernel/fork.c
autofs4: fix waitq memory leak
[linux-2.6-omap-h63xx.git] / kernel / fork.c
index adefc1131f274082960de7f375a67d4949cdfe27..552c8d8e77ad5e3fb43f606081c57023bb25e4c6 100644 (file)
@@ -33,6 +33,7 @@
 #include <linux/cpu.h>
 #include <linux/cgroup.h>
 #include <linux/security.h>
+#include <linux/hugetlb.h>
 #include <linux/swap.h>
 #include <linux/syscalls.h>
 #include <linux/jiffies.h>
@@ -306,6 +307,14 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
                        spin_unlock(&file->f_mapping->i_mmap_lock);
                }
 
+               /*
+                * Clear hugetlb-related page reserves for children. This only
+                * affects MAP_PRIVATE mappings. Faults generated by the child
+                * are not guaranteed to succeed, even if read-only
+                */
+               if (is_vm_hugetlb_page(tmp))
+                       reset_vma_resv_huge_pages(tmp);
+
                /*
                 * Link in the new vma and copy the page table entries.
                 */