linux-next: build failure after merge of the mm tree

Stephen Rothwell posted 1 patch 1 year ago
There is a newer version of this series
include/linux/memfd.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
linux-next: build failure after merge of the mm tree
Posted by Stephen Rothwell 1 year ago
Hi all,

After merging the mm tree, today's linux-next build (x86_64 allnoconfig)
failed like this:

In file included from mm/mmap.c:50:
include/linux/memfd.h:27:5: warning: no previous prototype for 'memfd_check_seals_mmap' [-Wmissing-prototypes]
   27 | int memfd_check_seals_mmap(struct file *file, unsigned long *vm_flags)
      |     ^~~~~~~~~~~~~~~~~~~~~~
In file included from fs/fcntl.c:26:
include/linux/memfd.h:27:5: warning: no previous prototype for 'memfd_check_seals_mmap' [-Wmissing-prototypes]
   27 | int memfd_check_seals_mmap(struct file *file, unsigned long *vm_flags)
      |     ^~~~~~~~~~~~~~~~~~~~~~
In file included from mm/gup.c:8:
include/linux/memfd.h:27:5: warning: no previous prototype for 'memfd_check_seals_mmap' [-Wmissing-prototypes]
   27 | int memfd_check_seals_mmap(struct file *file, unsigned long *vm_flags)
      |     ^~~~~~~~~~~~~~~~~~~~~~
In file included from mm/secretmem.c:12:
include/linux/memfd.h:27:5: warning: no previous prototype for 'memfd_check_seals_mmap' [-Wmissing-prototypes]
   27 | int memfd_check_seals_mmap(struct file *file, unsigned long *vm_flags)
      |     ^~~~~~~~~~~~~~~~~~~~~~
x86_64-linux-gnu-ld: mm/mmap.o: in function `memfd_check_seals_mmap':
mmap.c:(.text+0x200): multiple definition of `memfd_check_seals_mmap'; mm/gup.o:gup.c:(.text+0xf60): first defined here
x86_64-linux-gnu-ld: mm/secretmem.o: in function `memfd_check_seals_mmap':
secretmem.c:(.text+0x3c0): multiple definition of `memfd_check_seals_mmap'; mm/gup.o:gup.c:(.text+0xf60): first defined here
x86_64-linux-gnu-ld: fs/fcntl.o: in function `memfd_check_seals_mmap':
fcntl.c:(.text+0x270): multiple definition of `memfd_check_seals_mmap'; mm/gup.o:gup.c:(.text+0xf60): first defined here

Caused by commit

  6b72648c4e2b ("mm: perform all memfd seal checks in a single place")

from the mm-unstable branch of the mm tree.

I have applied the following patch for today:

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Mon, 9 Dec 2024 15:23:48 +1100
Subject: [PATCH] fix up for "mm: perform all memfd seal checks in a single place"

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 include/linux/memfd.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/memfd.h b/include/linux/memfd.h
index d53408b0bd31..4397e3b4f0f9 100644
--- a/include/linux/memfd.h
+++ b/include/linux/memfd.h
@@ -24,7 +24,7 @@ static inline struct folio *memfd_alloc_folio(struct file *memfd, pgoff_t idx)
 {
 	return ERR_PTR(-EINVAL);
 }
-int memfd_check_seals_mmap(struct file *file, unsigned long *vm_flags)
+static inline int memfd_check_seals_mmap(struct file *file, unsigned long *vm_flags)
 {
 	return 0;
 }
-- 
2.45.2

-- 
Cheers,
Stephen Rothwell
Re: linux-next: build failure after merge of the mm tree
Posted by Lorenzo Stoakes 1 year ago
On Mon, Dec 09, 2024 at 03:28:26PM +1100, Stephen Rothwell wrote:
> Hi all,
>
> After merging the mm tree, today's linux-next build (x86_64 allnoconfig)
> failed like this:
>
> In file included from mm/mmap.c:50:
> include/linux/memfd.h:27:5: warning: no previous prototype for 'memfd_check_seals_mmap' [-Wmissing-prototypes]
>    27 | int memfd_check_seals_mmap(struct file *file, unsigned long *vm_flags)
>       |     ^~~~~~~~~~~~~~~~~~~~~~
> In file included from fs/fcntl.c:26:
> include/linux/memfd.h:27:5: warning: no previous prototype for 'memfd_check_seals_mmap' [-Wmissing-prototypes]
>    27 | int memfd_check_seals_mmap(struct file *file, unsigned long *vm_flags)
>       |     ^~~~~~~~~~~~~~~~~~~~~~
> In file included from mm/gup.c:8:
> include/linux/memfd.h:27:5: warning: no previous prototype for 'memfd_check_seals_mmap' [-Wmissing-prototypes]
>    27 | int memfd_check_seals_mmap(struct file *file, unsigned long *vm_flags)
>       |     ^~~~~~~~~~~~~~~~~~~~~~
> In file included from mm/secretmem.c:12:
> include/linux/memfd.h:27:5: warning: no previous prototype for 'memfd_check_seals_mmap' [-Wmissing-prototypes]
>    27 | int memfd_check_seals_mmap(struct file *file, unsigned long *vm_flags)
>       |     ^~~~~~~~~~~~~~~~~~~~~~
> x86_64-linux-gnu-ld: mm/mmap.o: in function `memfd_check_seals_mmap':
> mmap.c:(.text+0x200): multiple definition of `memfd_check_seals_mmap'; mm/gup.o:gup.c:(.text+0xf60): first defined here
> x86_64-linux-gnu-ld: mm/secretmem.o: in function `memfd_check_seals_mmap':
> secretmem.c:(.text+0x3c0): multiple definition of `memfd_check_seals_mmap'; mm/gup.o:gup.c:(.text+0xf60): first defined here
> x86_64-linux-gnu-ld: fs/fcntl.o: in function `memfd_check_seals_mmap':
> fcntl.c:(.text+0x270): multiple definition of `memfd_check_seals_mmap'; mm/gup.o:gup.c:(.text+0xf60): first defined here
>
> Caused by commit
>
>   6b72648c4e2b ("mm: perform all memfd seal checks in a single place")
>
> from the mm-unstable branch of the mm tree.
>
> I have applied the following patch for today:
>
> From: Stephen Rothwell <sfr@canb.auug.org.au>
> Date: Mon, 9 Dec 2024 15:23:48 +1100
> Subject: [PATCH] fix up for "mm: perform all memfd seal checks in a single place"
>
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
>  include/linux/memfd.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/memfd.h b/include/linux/memfd.h
> index d53408b0bd31..4397e3b4f0f9 100644
> --- a/include/linux/memfd.h
> +++ b/include/linux/memfd.h
> @@ -24,7 +24,7 @@ static inline struct folio *memfd_alloc_folio(struct file *memfd, pgoff_t idx)
>  {
>  	return ERR_PTR(-EINVAL);
>  }
> -int memfd_check_seals_mmap(struct file *file, unsigned long *vm_flags)
> +static inline int memfd_check_seals_mmap(struct file *file, unsigned long *vm_flags)
>  {
>  	return 0;
>  }
> --

Thanks, apologies for this, a rather silly typo. I have now sent a
fix-patch to Andrew so hopefully this should come out in the wash also from
mm side.

> 2.45.2
>
> --
> Cheers,
> Stephen Rothwell