[PATCHv3 2/2] nvme: keyring: fix conditional compilation

Christoph Hellwig hch at lst.de
Tue Nov 7 23:11:04 PST 2023


On Tue, Nov 07, 2023 at 10:14:21AM -0800, Keith Busch wrote:
> From: Hannes Reinecke <hare at suse.de>
> 
> The keyring and auth functions can be called from both the host and
> the target side and are controlled by Kconfig options for each of the
> combinations, but the declarations are controlled by #ifdef checks
> on the shared Kconfig symbols.
> 
> This leads to link failures in combinations where one of the frontends
> is built-in and the other one is a module, and the keyring code
> ends up in a module that is not reachable from the builtin code:
> 
> ld: drivers/nvme/host/core.o: in function `nvme_core_exit':
> core.c:(.exit.text+0x4): undefined reference to `nvme_keyring_exit'
> ld: drivers/nvme/host/core.o: in function `nvme_core_init':
> core.c:(.init.text+0x94): undefined reference to `nvme_keyring_init
> 
> ld: drivers/nvme/host/tcp.o: in function `nvme_tcp_setup_ctrl':
> tcp.c:(.text+0x4c18): undefined reference to `nvme_tls_psk_default'
> 
> Address this by moving nvme_keyring_init()/nvme_keyring_exit() into
> module init/exit functions for the keyring module.
> 
> Fixes: be8e82caa6859 ("nvme-tcp: enable TLS handshake upcall")
> Signed-off-by: Hannes Reinecke <hare at suse.de>
> Cc: Arnd Bergmann <arnd at arndb.de>
> Signed-off-by: Keith Busch <kbusch at kernel.org>

Looks good:

Reviewed-by: Christoph Hellwig <hch at lst.de>

If we go with my suggestion on the previous patch this should
still work at least for now.  If the auth side would ever grow
initialization helpers we'd then need to move the main
module_init/exit to the common file and call out to auth and
keyring.




More information about the Linux-nvme mailing list