IMHO the BUG_ON(vma->vm_flags & VM_PFNMAP); in vm_insert_page should just become a WARN_ON_ONCE with an error return, and then we just need to gradually fix up the callers that trigger it instead of coming up with workarounds like this.
IMHO the BUG_ON(vma->vm_flags & VM_PFNMAP); in vm_insert_page should just become a WARN_ON_ONCE with an error return, and then we just need to gradually fix up the callers that trigger it instead of coming up with workarounds like this.