diff options
Diffstat (limited to 'fs/dax.c')
-rw-r--r-- | fs/dax.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -1383,6 +1383,16 @@ static int dax_iomap_pmd_fault(struct vm_fault *vmf, | |||
1383 | 1383 | ||
1384 | trace_dax_pmd_fault(inode, vmf, max_pgoff, 0); | 1384 | trace_dax_pmd_fault(inode, vmf, max_pgoff, 0); |
1385 | 1385 | ||
1386 | /* | ||
1387 | * Make sure that the faulting address's PMD offset (color) matches | ||
1388 | * the PMD offset from the start of the file. This is necessary so | ||
1389 | * that a PMD range in the page table overlaps exactly with a PMD | ||
1390 | * range in the radix tree. | ||
1391 | */ | ||
1392 | if ((vmf->pgoff & PG_PMD_COLOUR) != | ||
1393 | ((vmf->address >> PAGE_SHIFT) & PG_PMD_COLOUR)) | ||
1394 | goto fallback; | ||
1395 | |||
1386 | /* Fall back to PTEs if we're going to COW */ | 1396 | /* Fall back to PTEs if we're going to COW */ |
1387 | if (write && !(vma->vm_flags & VM_SHARED)) | 1397 | if (write && !(vma->vm_flags & VM_SHARED)) |
1388 | goto fallback; | 1398 | goto fallback; |