X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=mm%2Fhugetlb.c;h=bd031a4c738e7b1083bb18453109cfb2a62e7087;hb=998b4382c1d75a6fd3b0e334dae3ab33bd074d99;hp=c03273807182dde1d9dd2e905c0db11a6dfe2441;hpb=fdb8c58a1671beb51949412e053926acd5500b5f;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git diff --git a/mm/hugetlb.c b/mm/hugetlb.c index c032738..bd031a4 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -2515,22 +2515,19 @@ retry: hugepage_add_new_anon_rmap(page, vma, address); } } else { + /* + * If memory error occurs between mmap() and fault, some process + * don't have hwpoisoned swap entry for errored virtual address. + * So we need to block hugepage fault by PG_hwpoison bit check. + */ + if (unlikely(PageHWPoison(page))) { + ret = VM_FAULT_HWPOISON; + goto backout_unlocked; + } page_dup_rmap(page); } /* - * Since memory error handler replaces pte into hwpoison swap entry - * at the time of error handling, a process which reserved but not have - * the mapping to the error hugepage does not have hwpoison swap entry. - * So we need to block accesses from such a process by checking - * PG_hwpoison bit here. - */ - if (unlikely(PageHWPoison(page))) { - ret = VM_FAULT_HWPOISON; - goto backout_unlocked; - } - - /* * If we are going to COW a private mapping later, we examine the * pending reservations for this page now. This will ensure that * any allocations necessary to record that reservation occur outside