Merge branch 'hwpoison' of git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux...
[sfrench/cifs-2.6.git] / mm / hugetlb.c
index 303fb0c02364c3a5422db9163e1d0aca4b445e95..cc5be788a39fe132c72cbc1d2fb1c03f71708575 100644 (file)
@@ -2397,6 +2397,9 @@ retry_avoidcopy:
        ptep = huge_pte_offset(mm, address & huge_page_mask(h));
        if (likely(pte_same(huge_ptep_get(ptep), pte))) {
                /* Break COW */
+               mmu_notifier_invalidate_range_start(mm,
+                       address & huge_page_mask(h),
+                       (address & huge_page_mask(h)) + huge_page_size(h));
                huge_ptep_clear_flush(vma, address, ptep);
                set_huge_pte_at(mm, address, ptep,
                                make_huge_pte(vma, new_page, 1));
@@ -2404,6 +2407,9 @@ retry_avoidcopy:
                hugepage_add_anon_rmap(new_page, vma, address);
                /* Make the old page be freed below */
                new_page = old_page;
+               mmu_notifier_invalidate_range_end(mm,
+                       address & huge_page_mask(h),
+                       (address & huge_page_mask(h)) + huge_page_size(h));
        }
        page_cache_release(new_page);
        page_cache_release(old_page);