* + userfaultfd-reset-err-to-be-0-when-move_pages_ptes-succeeded.patch added to mm-hotfixes-unstable branch
@ 2026-08-19 3:29 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-08-19 3:29 UTC (permalink / raw)
To: mm-commits, surenb, rppt, peterx, foxieflakey, akpm
The patch titled
Subject: userfaultfd: reset err to be 0 when move_pages_ptes succeeded
has been added to the -mm mm-hotfixes-unstable branch. Its filename is
userfaultfd-reset-err-to-be-0-when-move_pages_ptes-succeeded.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/userfaultfd-reset-err-to-be-0-when-move_pages_ptes-succeeded.patch
This patch will later appear in the mm-hotfixes-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days
------------------------------------------------------
From: Bryan Lim <foxieflakey@gmail.com>
Subject: userfaultfd: reset err to be 0 when move_pages_ptes succeeded
Date: Wed, 19 Aug 2026 10:08:24 +0700 (WIB)
During move_pages() operation, when move_pages_ptes() returns EAGAIN, the
error code is not cleared even after we processed it. This leads to a
successful retry but then the same pages are retried again due to the
stale error code. This time move fails because pages are already moved,
loop is terminated and move_pages() reports a failure. Clear the error
code once we processes EAGAIN.
Link: https://lore.kernel.org/e1e0b5f8-c3c6-0537-670b-4397f822f980@gmail.com
Fixes: 50944692052b ("userfaultfd: opportunistic TLB-flush batching for present pages in MOVE")
Assisted-by: ChatGPT:GPT-5.6-Luna
Signed-off-by: Bryan Lim <foxieflakey@gmail.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Peter Xu <peterx@redhat.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/userfaultfd.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/mm/userfaultfd.c~userfaultfd-reset-err-to-be-0-when-move_pages_ptes-succeeded
+++ a/mm/userfaultfd.c
@@ -2085,8 +2085,10 @@ static ssize_t move_pages(struct userfau
}
if (err) {
- if (err == -EAGAIN)
+ if (err == -EAGAIN) {
+ err = 0;
continue;
+ }
break;
}
_
Patches currently in -mm which might be from foxieflakey@gmail.com are
userfaultfd-reset-err-to-be-0-when-move_pages_ptes-succeeded.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-08-19 3:29 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-19 3:29 + userfaultfd-reset-err-to-be-0-when-move_pages_ptes-succeeded.patch added to mm-hotfixes-unstable branch Andrew Morton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.