mm: thp: fix up pmd_trans_unstable() locations
[~shefty/rdma-dev.git] / fs / proc / task_mmu.c
index 9694cc2835115f18c5c6f9719d8ab9a332631901..c283832d411d4ea79170210e68fb27f008aa49ea 100644 (file)
@@ -781,9 +781,6 @@ static int pagemap_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end,
        int err = 0;
        pagemap_entry_t pme = make_pme(PM_NOT_PRESENT);
 
-       if (pmd_trans_unstable(pmd))
-               return 0;
-
        /* find the first VMA at or above 'addr' */
        vma = find_vma(walk->mm, addr);
        spin_lock(&walk->mm->page_table_lock);
@@ -802,6 +799,8 @@ static int pagemap_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end,
                return err;
        }
 
+       if (pmd_trans_unstable(pmd))
+               return 0;
        for (; addr != end; addr += PAGE_SIZE) {
 
                /* check to see if we've left 'vma' behind