rus_vm_fault: vmf_insert_pfn: treat VM_FAULT_NOPAGE as success
vmf_insert_pfn is added with the following commit. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=1c8f422059ae5da07db7406ab916203f9417e396 Refer to the following page for the meaning of VM_FAULT_NOPAGE. https://lwn.net/Articles/242237/ Change-Id: I2b0144a20a57c74e0e2e0d2fc24281852f49b717
This commit is contained in:
@@ -692,14 +692,20 @@ static int rus_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
|
|||||||
vma->vm_start, vma->vm_end, pgsize, pix);
|
vma->vm_start, vma->vm_end, pgsize, pix);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 0)
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 0)
|
||||||
error = vmf_insert_pfn(vma, rva+(pix*PAGE_SIZE),
|
error = vmf_insert_pfn(vma, rva+(pix*PAGE_SIZE),
|
||||||
pfn+pix);
|
pfn+pix);
|
||||||
|
if (error == VM_FAULT_NOPAGE) {
|
||||||
|
dprintk("%s: vmf_insert_pfn returned %d\n",
|
||||||
|
__func__, error);
|
||||||
|
error = 0;
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
error = vm_insert_pfn(vma, rva+(pix*PAGE_SIZE),
|
error = vm_insert_pfn(vma, rva+(pix*PAGE_SIZE),
|
||||||
pfn+pix);
|
pfn+pix);
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
if (error) {
|
if (error) {
|
||||||
pr_err("%s: vm_insert_pfn returned %d\n",
|
pr_err("%s: vm_insert_pfn returned %d\n",
|
||||||
__func__, error);
|
__func__, error);
|
||||||
|
|||||||
Reference in New Issue
Block a user