Re: [PATCH] userfaultfd: reset err to be 0 when move_pages_ptes succeeded

From: Andrew Morton

Date: Mon Aug 17 2026 - 18:35:10 EST


On Mon, 17 Aug 2026 15:26:05 -0700 Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:

> > That behaviour manifested into this at userspace
> >
> > Source: [ .. unmapped .. ][ .. mapped ..]
> > Destination: [ .. mapped .. ][ .. unmapped ..]
> > ^ ^
> > \ Kernel moved this far in actuality
> > What is reported to userspace on struct
> > uffdio_move's move field
> >
> > When the previous behaviour is
> > Source: [ .. unmapped .. ][ .. mapped ..]
> > Destination: [ .. mapped .. ][ .. unmapped ..]
> > ^
> > Reported to user space via uffdio_move's
> > move field

Also...

I assume the above illuminates lack of coverage in the uffd selftests.
Is it hard to add a case to detect this?