@@ -418,6 +418,7 @@ static vm_fault_t dev_dax_huge_fault(struct vm_fault *vmf,
if (rc == VM_FAULT_NOPAGE) {
unsigned long i;
+ pgoff_t pgoff;
/*
* In the device-dax case the only possibility for a
@@ -425,6 +426,8 @@ static vm_fault_t dev_dax_huge_fault(struct vm_fault *vmf,
* mapped. No need to consider the zero page, or racing
* conflicting mappings.
*/
+ pgoff = linear_page_index(vma, vmf->address
+ & ~(fault_size - 1));
for (i = 0; i < fault_size / PAGE_SIZE; i++) {
struct page *page;
@@ -432,6 +435,7 @@ static vm_fault_t dev_dax_huge_fault(struct vm_fault *vmf,
if (page->mapping)
continue;
page->mapping = filp->f_mapping;
+ page->index = pgoff + i;
}
}
dax_read_unlock(id);