summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mm/gup.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/mm/gup.c b/mm/gup.c
index 1e67461b2733..94fab8fa432b 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -272,8 +272,6 @@ struct page *follow_page_mask(struct vm_area_struct *vma,
return page;
return no_page_table(vma, flags);
}
- if ((flags & FOLL_NUMA) && pmd_protnone(*pmd))
- return no_page_table(vma, flags);
if (pmd_devmap(*pmd)) {
ptl = pmd_lock(mm, pmd);
page = follow_devmap_pmd(vma, address, pmd, flags);
@@ -284,6 +282,9 @@ struct page *follow_page_mask(struct vm_area_struct *vma,
if (likely(!pmd_trans_huge(*pmd)))
return follow_page_pte(vma, address, pmd, flags);
+ if ((flags & FOLL_NUMA) && pmd_protnone(*pmd))
+ return no_page_table(vma, flags);
+
ptl = pmd_lock(mm, pmd);
if (unlikely(!pmd_trans_huge(*pmd))) {
spin_unlock(ptl);