mm: avoid setting up anonymous pages into file mapping
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / mm / hugetlb.c
index 7de4f67c81fec86b40024ff2db62e1992786c609..d9bc87ca062bf8caaaa7c5a0be44cbef2c0e0a5d 100644 (file)
@@ -2451,9 +2451,10 @@ again:
                        continue;
 
                /*
-                * HWPoisoned hugepage is already unmapped and dropped reference
+                * Migrating hugepage or HWPoisoned hugepage is already
+                * unmapped and its refcount is dropped, so just clear pte here.
                 */
-               if (unlikely(is_hugetlb_entry_hwpoisoned(pte))) {
+               if (unlikely(!pte_present(pte))) {
                        huge_pte_clear(mm, address, ptep);
                        continue;
                }