From e50a659f074c285968a7404c0da2295093579509 Mon Sep 17 00:00:00 2001 From: Logan Gunthorpe Date: Tue, 17 Mar 2015 16:15:01 -0600 Subject: [PATCH] Add VM_MIXEDMAP support to follow_pfn VM_MIXEDMAPs which are created by mmaping files in DAX capable filesystem do have valid PFNs. However, there is no obvious way to get the PFN from a VMA because follow_pfn is limitted to VMAs with the VM_IO or VM_PFNMAP flags. If we add VM_MIXEDMAP to this check we can get the PFN in the same way we do for VM_PFNMAPs. --- mm/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/memory.c b/mm/memory.c index 65914c739db1..c59991e2de92 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -3533,7 +3533,7 @@ int follow_pfn(struct vm_area_struct *vma, unsigned long address, spinlock_t *ptl; pte_t *ptep; - if (!(vma->vm_flags & (VM_IO | VM_PFNMAP))) + if (!(vma->vm_flags & (VM_IO | VM_PFNMAP | VM_MIXEDMAP))) return ret; ret = follow_pte(vma->vm_mm, address, &ptep, &ptl);