Created attachment 33412 [details] A test program demonstrating the bug If a file is opened with O_RDONLY and then mmap()ed, calling remap_file_pages() on the mapped region fails with EINVAL. The attached test program demonstrates the problem: compile and run it, and it will fail with "remap_file_pages: Invalid argument". Change O_RDONLY in the second open() call to O_RDWR and it will stop failing. Of course, this is not a useful workaround if one doesn't have write access to the target file!
Created attachment 103261 [details] Bug fix
Why is this resolved? 4.14.83 still has the same problem.