nvme-tcp: fix link failure for TCP auth
PATCH 1/1 nvme-tcp: fix link failure for TCP auth
From: Arnd Bergmann <[email protected]>
The nvme fabric driver calls the nvme_tls_key_lookup() function from nvmf_parse_key() when the keyring is enabled, but this is broken in a configuration with CONFIG_NVME_FABRICS=y and CONFIG_NVME_TCP=m because this leads to the function definition being in a loadable module:
x86_64-linux-ld: vmlinux.o: in function `nvmf_parse_key':
fabrics.c:(.text+0xb1bdec): undefined reference to `nvme_tls_key_lookup'
Move the 'select' up to CONFIG_NVME_FABRICS itself to force this part to be built-in as well if needed.
---
It may alternatively be possible to rework the code so the keyring is only referenced when CONFIG_NVME_HOST_AUTH is also set, but this version is simpler and leaves the code unchanged.
--- drivers/nvme/host/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/Kconfig +1 -1
@@ -41,6 +41,7 @@ config NVME_HWMON config NVME_FABRICS select NVME_CORE + select NVME_KEYRING if NVME_TCP_TLS tristate config NVME_RDMA
@@ -94,7 +95,6 @@ config NVME_TCP config NVME_TCP_TLS bool "NVMe over Fabrics TCP TLS encryption support" depends on NVME_TCP - select NVME_KEYRING select NET_HANDSHAKE select KEYS help
Signature · 1 line
2.39.2
Looks good to me,
Quoted 10 lines · Arnd Bergmann
The nvme fabric driver calls the
nvme_tls_key_lookup()function fromnvmf_parse_key()when the keyring is enabled, but this is broken in a configuration withCONFIG_NVME_FABRICS=yandCONFIG_NVME_TCP=mbecause this leads to the function definition being in a loadable module:x86_64-linux-ld: vmlinux.o: in function `nvmf_parse_key':
fabrics.c:(.text+0xb1bdec): undefined reference to `nvme_tls_key_lookup'Move the 'select' up to
CONFIG_NVME_FABRICSitself to force this part to be built-in as well if needed.
Thanks, applied to nvme-6.12.
I even try to test for these odd module vs built-in scenarios, but I missed this one. :(
Quoted 3 lines
It may alternatively be possible to rework the code so the keyring is only referenced when
CONFIG_NVME_HOST_AUTHis also set, but this version is simpler and leaves the code unchanged.
That sounds like a cleaner solution longer term, but I agree your patch is the simpler way to handle the breakage.