Subject: linux-next: build failure after merge of the vfs-brauner tree

From: Stephen Rothwell <[email-masked]>
Date: Wed, 21 May 2025 20:49:23 +1000

Hi all,

After merging the vfs-brauner tree, today's linux-next build (x86_84
allnoconfig) failed like this:

x86_64-linux-gnu-ld: fs/coredump.o: in function `do_coredump':
coredump.c:(.text+0x1795): undefined reference to `sock_from_file'
x86_64-linux-gnu-ld: coredump.c:(.text+0x17a6): undefined reference to `sock_from_file'
x86_64-linux-gnu-ld: coredump.c:(.text+0x17b3): undefined reference to `kernel_sock_shutdown'

Caused by commit

  997e88a74ed6 ("coredump: add coredump socket")

# CONFIG_NET is not set

I have applied the following hack for today to make it build.

From: Stephen Rothwell <[email-masked]>
Date: Wed, 21 May 2025 20:41:32 +1000
Subject: [PATCH] hack for "coredump: add coredump socket" and !CONFIG_NET

Signed-off-by: Stephen Rothwell <[email-masked]>
---
 fs/coredump.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/coredump.c b/fs/coredump.c
index cb727a5b59ac..62d1584b24ff 100644
--- a/fs/coredump.c
+++ b/fs/coredump.c
@@ -962,8 +962,10 @@ void do_coredump(const kernel_siginfo_t *siginfo)
 		free_vma_snapshot(&cprm);
 	}
 
+#ifdef CONFIG_NET
 	if (sock_from_file(cprm.file))
 		kernel_sock_shutdown(sock_from_file(cprm.file), SHUT_WR);
+#endif
 
 	/*
 	 * When core_pipe_limit is set we wait for the coredump server
@@ -975,6 +977,7 @@ void do_coredump(const kernel_siginfo_t *siginfo)
 		case COREDUMP_PIPE:
 			wait_for_dump_helpers(cprm.file);
 			break;
+#ifdef CONFIG_NET
 		case COREDUMP_SOCK: {
 			/*
 			 * We use a simple read to wait for the coredump
@@ -985,6 +988,7 @@ void do_coredump(const kernel_siginfo_t *siginfo)
 			__kernel_read(cprm.file, &(char){ 0 }, 1, NULL);
 			break;
 		}
+#endif
 		default:
 			break;
 		}
-- 
2.47.2

-- 
Cheers,
Stephen Rothwell