]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
queue-6.12: fix duplicate inline in mm/slab backport
authorSasha Levin <sashal@kernel.org>
Sat, 8 Aug 2026 03:07:18 +0000 (23:07 -0400)
committerSasha Levin <sashal@kernel.org>
Sat, 8 Aug 2026 11:09:45 +0000 (07:09 -0400)
The 6.12 backport of d9e6a7623938 ("mm/slab: prevent unbounded recursion
in free path with new kmalloc type") adds a stable-only adjustment that
marks need_kmalloc_no_objext() __always_inline, because
mem_alloc_profiling_permanently_disabled() is __init in 6.12.  The
adjustment was written as:

  static __always_inline inline bool need_kmalloc_no_objext(void)

__always_inline already expands to "inline __attribute__((__always_inline__))"
and inline is itself a macro, so the declaration ends up with two inline
specifiers.  clang rejects that with -Wduplicate-decl-specifier, which is
an error with CONFIG_WERROR:

  In file included from mm/mempool.c:21:
  mm/slab.h:572:24: error: duplicate 'inline' declaration specifier [-Werror,-Wduplicate-decl-specifier]
    572 | static __always_inline inline bool need_kmalloc_no_objext(void)
        |                        ^

Reported by KernelCI as a build regression on stable-rc/linux-6.12.y, and
confirmed by Nathan Chancellor, who pointed out the correct fix: drop the
redundant inline and keep __always_inline.

The 6.18 and 7.1 backports of the same commit use plain "static inline"
and are not affected.

Reported-by: KernelCI bot <bot@kernelci.org>
Reported-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/stable/20260807180245.GA4067747@ax162/
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-6.12/mm-slab-prevent-unbounded-recursion-in-free-path-wit.patch

index 3c3b0573185e6a88cd977dc42ff01d71900c3a31..ee935e36228845544d99641d8583fc509b014648 100644 (file)
@@ -207,7 +207,7 @@ index b65d2462b3fdb..34a3d65b4ef5f 100644
 + * Memcg usually doesn't need them for normal kmalloc caches, but kmalloc types
 + * with a priority higher than KMALLOC_CGROUP can be aliased with KMALLOC_NORMAL.
 + */
-+static __always_inline inline bool need_kmalloc_no_objext(void)
++static __always_inline bool need_kmalloc_no_objext(void)
 +{
 +      if (!mem_alloc_profiling_permanently_disabled())
 +              return true;