Skip to contentSkip to conversation

FAILED: patch "[PATCH] mm/mremap: fix BUILD_BUG_ON() error in get_extent" failed to apply to 5.10-stable tree

PATCH [email protected] 1 participant 1 message Feb 15, 2021

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 5.10-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From a30a29091b5a6d4c64b5fc77040720a65e2dd4e6 Mon Sep 17 00:00:00 2001
From: Arnd Bergmann <[email protected]>
Date: Tue, 9 Feb 2021 13:42:10 -0800
Subject: [PATCH] mm/mremap: fix BUILD_BUG_ON() error in get_extent

clang can't evaluate this function argument at compile time when the function is not inlined, which leads to a link time failure:

ld.lld: error: undefined symbol: __compiletime_assert_414

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

referenced by mremap.c
mremap.o:(get_extent) in archive mm/built-in.a

Mark the function as __always_inline to avoid it.

Fixes 9ad9718bfa41 ("mm/mremap: calculate extent in one place")
Cc Kirill A. Shutemov" <[email protected]>
Cc Wei Yang <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Dmitry Safonov <[email protected]>
Cc Brian Geffon <[email protected]>
mm/mremap.c +3 -2
index f554320281cc..aa63bfd3cad2 100644
@@ -336,8 +336,9 @@ enum pgt_entry {
  * valid. Else returns a smaller extent bounded by the end of the source and
  * destination pgt_entry.
  */
-static unsigned long get_extent(enum pgt_entry entry, unsigned long old_addr,
-			unsigned long old_end, unsigned long new_addr)
+static __always_inline unsigned long get_extent(enum pgt_entry entry,
+			unsigned long old_addr, unsigned long old_end,
+			unsigned long new_addr)
 {
 	unsigned long next, extent, mask, size;