Merge tag 'io_uring-5.15-2021-09-11' of git://git.kernel.dk/linux-block
[linux-2.6-microblaze.git] / mm / hmm.c
index fad6be2..842e265 100644 (file)
--- a/mm/hmm.c
+++ b/mm/hmm.c
@@ -295,10 +295,13 @@ static int hmm_vma_handle_pte(struct mm_walk *walk, unsigned long addr,
                goto fault;
 
        /*
+        * Bypass devmap pte such as DAX page when all pfn requested
+        * flags(pfn_req_flags) are fulfilled.
         * Since each architecture defines a struct page for the zero page, just
         * fall through and treat it like a normal page.
         */
-       if (pte_special(pte) && !is_zero_pfn(pte_pfn(pte))) {
+       if (pte_special(pte) && !pte_devmap(pte) &&
+           !is_zero_pfn(pte_pfn(pte))) {
                if (hmm_pte_need_fault(hmm_vma_walk, pfn_req_flags, 0)) {
                        pte_unmap(ptep);
                        return -EFAULT;