Re: [PATCH 02/10] mm: convert core mm to mm_flags_*() accessors

Andrew Morton
2025-09-17T23:40:40Z

On Wed, 17 Sep 2025 06:16:37 +0100 Lorenzo Stoakes <lorenzo.stoakes@oracle.com> wrote:

> Hi Andrew,
>
> Please apply the below fixpatch to account for an accidentally inverted check.
>
> Thanks, Lorenzo

The fixee is now in mm-stable so I turned this into a standalone thing.

(hate having to do it this way! A place where git requirements simply
don't match the workflow)

From: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Subject: mm/oom_kill.c: fix inverted check
Date: Wed, 17 Sep 2025 06:16:37 +0100

Fix an incorrect logic conversion in process_mrelease().

Link: https://lkml.kernel.org/r/3b7f0faf-4dbc-4d67-8a71-752fbcdf0906@lucifer.local
Fixes: 12e423ba4eae ("mm: convert core mm to mm_flags_*() accessors")
Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Reported-by: Chris Mason <clm@meta.com>
Closes: https://lkml.kernel.org/r/c2e28e27-d84b-4671-8784-de5fe0d14f41@lucifer.local
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

mm/oom_kill.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/mm/oom_kill.c~mm-oom_killc-fix-inverted-check
+++ a/mm/oom_kill.c
@@ -1257,7 +1257,7 @@ SYSCALL_DEFINE2(process_mrelease, int, p
* Check MMF_OOM_SKIP again under mmap_read_lock protection to ensure
* possible change in exit_mmap is seen
*/
- if (mm_flags_test(MMF_OOM_SKIP, mm) && !__oom_reap_task_mm(mm))
+ if (!mm_flags_test(MMF_OOM_SKIP, mm) && !__oom_reap_task_mm(mm))
ret = -EAGAIN;
mmap_read_unlock(mm);

_