Bug 219370 - link error while compiling localio.c
Summary: link error while compiling localio.c
Status: RESOLVED PATCH_ALREADY_AVAILABLE
Alias: None
Product: File System
Classification: Unclassified
Component: NFSD (show other bugs)
Hardware: AMD Linux
: P3 normal
Assignee: Mike Snitzer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-10 07:09 UTC by Janpieter Sollie
Modified: 2024-10-22 14:12 UTC (History)
2 users (show)

See Also:
Kernel Version: 6.12-rc2,6.12-rc1
Subsystem:
Regression: Yes
Bisected commit-id: fa4983862e506d395acc1b8d14dbebf63acc2e82


Attachments
kernel .config (130.19 KB, text/plain)
2024-10-10 07:09 UTC, Janpieter Sollie
Details

Description Janpieter Sollie 2024-10-10 07:09:04 UTC
Created attachment 306999 [details]
kernel .config

tried both GCC and clang:
Clang output:
> ld.lld: error: undefined symbol: nfs_to
> >>> referenced by localio.c:37 (fs/nfsd/localio.c:37)
> >>>               vmlinux.o:(init_nfsd)
> >>> referenced by localio.c:37 (/usr/src/linux/fs/nfsd/localio.c:37)
> >>>               vmlinux.o:(nfsd_localio_ops_init)
> 
> ld.lld: error: undefined symbol: nfs_uuid_invalidate_clients
> >>> referenced by nfsctl.c:2286 (/usr/src/linux/fs/nfsd/nfsctl.c:2286)
> >>>               vmlinux.o:(nfsd_net_pre_exit)
> 
> ld.lld: error: undefined symbol: nfs_uuid_is_local
> >>> referenced by localio.c:116 (/usr/src/linux/fs/nfsd/localio.c:116)
> >>>               vmlinux.o:(localio_proc_uuid_is_local)
GCC output:
ld: fs/nfsd/nfsctl.o: in function `nfsd_net_pre_exit':
nfsctl.c:(.text+0x122): undefined reference to `nfs_uuid_invalidate_clients'
ld: fs/nfsd/localio.o: in function `localio_proc_uuid_is_local':
/usr/src/linux/fs/nfsd/localio.c:116:(.text+0x56): undefined reference to `nfs_uuid_is_local'
ld: fs/nfsd/localio.o: in function `nfsd_localio_ops_init':
/usr/src/linux/fs/nfsd/localio.c:37:(.text+0x2c9): undefined reference to `nfs_to'

Command:
make -j64 or make LLVM=1 -j64

the config file for GCC will be attached, let me know if the clang version is desired as well

As you might guess, not trimming the unused symbols fixes the issue ...
Comment 1 Janpieter Sollie 2024-10-10 07:12:22 UTC
sorry, turns out I was wrong (had to do a make clean before):
removing the "trim unused exported symbols" option did NOT fix the issue, it simply masked it, turns out it was hidden somewhere else
Comment 2 Janpieter Sollie 2024-10-10 08:04:09 UTC
based on the bisected commit id, I turned off nfs localio option in kernel .config for 6.12-rc2, now it compiles.  Guess that's not surprising
Comment 3 The Linux kernel's regression tracker (Thorsten Leemhuis) 2024-10-10 10:51:04 UTC
FWIW, another report with similar symptoms can be found here:
https://lore.kernel.org/all/D4OUJRP8YWRM.ATQ7KASTYX5H@mbosch.me/T/#u
Comment 4 The Linux kernel's regression tracker (Thorsten Leemhuis) 2024-10-22 10:37:59 UTC
Was the problem resolved in between? 

And can I CC you on a lkml mail? This would expose your email address to the public.
Comment 5 Mike Snitzer 2024-10-22 13:59:10 UTC
This was fixed via v6.12-rc3 commit 009b15b57485 ("nfs_common: fix
Kconfig for NFS_COMMON_LOCALIO_SUPPORT")

In the provided kernel config:

CONFIG_NFS_FS=m
CONFIG_NFSD_V4=y
CONFIG_NFS_COMMON=y
CONFIG_NFS_COMMON_LOCALIO_SUPPORT=m
CONFIG_NFS_LOCALIO=y

My Kconfig fix will result in CONFIG_NFS_LOCALIO=m so that the symbols
are available to the nfs.ko kernel module.

But if you have any further issues, certainly let me know.
Comment 6 Mike Snitzer 2024-10-22 14:12:08 UTC
(In reply to Mike Snitzer from comment #5)
> This was fixed via v6.12-rc3 commit 009b15b57485 ("nfs_common: fix
> Kconfig for NFS_COMMON_LOCALIO_SUPPORT")
> 
> In the provided kernel config:
> 
> CONFIG_NFS_FS=m
> CONFIG_NFSD_V4=y
> CONFIG_NFS_COMMON=y
> CONFIG_NFS_COMMON_LOCALIO_SUPPORT=m
> CONFIG_NFS_LOCALIO=y
> 
> My Kconfig fix will result in CONFIG_NFS_LOCALIO=m so that the symbols
> are available to the nfs.ko kernel module.

Sorry, to be clear, the fix results in:

CONFIG_NFS_FS=m
CONFIG_NFSD=y
CONFIG_NFSD_V4=y
CONFIG_NFS_COMMON=y
CONFIG_NFS_COMMON_LOCALIO_SUPPORT=y
CONFIG_NFS_LOCALIO=y

Note You need to log in before you can comment on or make changes to this bug.