[PATCH] futex: Fix !CONFIG_FUTEX build

From: Jann Horn

Date: Fri Oct 02 2026 - 08:06:53 EST


futex_mm_init() is unconditionally referenced by mm_init(), so
!CONFIG_FUTEX builds require an empty inline version.

Fixes: fcbe4307bda0 ("futex: Fix mm reuse handling for FUT_OFF_MMSHARED")
Reported-by: kernel test robot <lkp@xxxxxxxxx>
Closes: https://lore.kernel.org/oe-kbuild-all/202610020501.bKHR1IPb-lkp@xxxxxxxxx/
Signed-off-by: Jann Horn <jannh@xxxxxxxxxx>
---
@peterz I'm not sure about the right process here...
I'm guessing that peterz/queue.git is a branch on which you can
still squash this into my other change?
Or should I fix this up locally and send a v2 of the original patch?

I'll make a note to myself to think more about weird kernel configs when
writing patches...

include/linux/futex.h | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/include/linux/futex.h b/include/linux/futex.h
index 7eb645e49dd4..a895d8c69d66 100644
--- a/include/linux/futex.h
+++ b/include/linux/futex.h
@@ -156,6 +156,10 @@ static inline void futex_set_vdso_cs_range(struct futex_mm_data *fd, unsigned in
static inline void futex_fixup_robust_unlock(struct pt_regs *regs) { }
#endif /* !CONFIG_FUTEX_ROBUST_UNLOCK */

+#ifdef CONFIG_FUTEX
void futex_mm_init(struct mm_struct *mm);
+#else
+static inline void futex_mm_init(struct mm_struct *mm) { }
+#endif /* !CONFIG_FUTEX */

#endif /* _LINUX_FUTEX_H */

base-commit: 6f8319e3e9a44dd537d17f41565a8453c560a581
prerequisite-patch-id: f52fa75faf6a5569e9c607696533ec5ea842ab35
--
2.56.0.rc1.315.gc6ed9934b7-goog