X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=blobdiff_plain;f=mm%2Fhugetlb.c;h=70b473338da0fd6d7a918afea573a3061a210535;hp=4c7d42af22e1123981aa0cfe98401bf1e333585a;hb=7ec0873ac3cba439ee9846e8cbc332cac0e6c1f5;hpb=e23d55ac7a8d76509ded2fd8f6e75e6d2c912e5c diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 4c7d42af22e1..70b473338da0 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -2889,7 +2889,17 @@ int follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma, break; } - if (absent || + /* + * We need call hugetlb_fault for both hugepages under migration + * (in which case hugetlb_fault waits for the migration,) and + * hwpoisoned hugepages (in which case we need to prevent the + * caller from accessing to them.) In order to do this, we use + * here is_swap_pte instead of is_hugetlb_entry_migration and + * is_hugetlb_entry_hwpoisoned. This is because it simply covers + * both cases, and because we can't follow correct pages + * directly from any kind of swap entries. + */ + if (absent || is_swap_pte(huge_ptep_get(pte)) || ((flags & FOLL_WRITE) && !pte_write(huge_ptep_get(pte)))) { int ret;