Re: [PATCH] userfaultfd/shmem: fix MCOPY_ATOMIC_CONTNUE error handling + accounting

2021-03-27 Thread Peter Xu
Axel, On Thu, Mar 25, 2021 at 04:10:27PM -0700, Axel Rasmussen wrote: > Previously, in the error path, we unconditionally removed the page from > the page cache. But in the continue case, we didn't add it - it was > already there because the page is used by a second (non-UFFD-registered) > mapping

[PATCH] userfaultfd/shmem: fix MCOPY_ATOMIC_CONTNUE error handling + accounting

2021-03-25 Thread Axel Rasmussen
Previously, in the error path, we unconditionally removed the page from the page cache. But in the continue case, we didn't add it - it was already there because the page is used by a second (non-UFFD-registered) mapping. So, in that case, it's incorrect to remove it as the other mapping may still