Skip to contentSkip to conversation

smb: fix smbdirect link failure

PATCH In review Arnd Bergmann 4 participants 4 messages Mar 6 – Mar 8

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 smb: fix smbdirect link failure

From: Arnd Bergmann <[email protected]>

When CONFIG_INFINIBAND is set to =m, it is not possible to have SMBDIRECT built-in, and it turns into a loadable module, but this does not prevent CIFS and SMB_SERVER from being built-in, which in turn causes this link error:

ld.lld-22: error: undefined symbol: smbdirect_socket_release

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

referenced by smbdirect.c:212 (fs/smb/client/smbdirect.c:212)
fs/smb/client/smbdirect.o:(smbd_destroy) in archive vmlinux.a
referenced by smbdirect.c:212 (fs/smb/client/smbdirect.c:212)
fs/smb/client/smbdirect.o:(smbd_reconnect) in archive vmlinux.a
referenced by smbdirect.c:338 (fs/smb/client/smbdirect.c:338)
fs/smb/client/smbdirect.o:(smbd_get_connection) in archive vmlinux.a

Enforce the dependency at Kconfig level, so that the respective smpdirect options are only offered if it's possible to link against the common module and infiniband.

Fixes 28504d6ee127 ("smb: client: make use of smbdirect.ko")
---
 fs/smb/client/Kconfig | 1 +
 fs/smb/server/Kconfig | 1 +
 2 files changed, 2 insertions(+)
fs/smb/client/Kconfig +1 -0
index 72f47669da0c..981b3b5be09b 100644
@@ -182,6 +182,7 @@ if CIFS
 config CIFS_SMB_DIRECT
 	bool "SMB Direct support"
 	depends on CIFS && INFINIBAND && INFINIBAND_ADDR_TRANS
+	depends on CIFS=m || INFINIBAND=y
 	select SMB_COMMON_SMBDIRECT
 	help
 	  Enables SMB Direct support for SMB 3.0, 3.02 and 3.1.1.
fs/smb/server/Kconfig +1 -0
index b084071d2442..5c77c5552ed8 100644
@@ -49,6 +49,7 @@ if SMB_SERVER
 config SMB_SERVER_SMBDIRECT
 	bool "Support for SMB Direct protocol"
 	depends on SMB_SERVER && INFINIBAND && INFINIBAND_ADDR_TRANS
+	depends on SMB_SERVER=m || INFINIBAND=y
 	select SMB_COMMON_SMBDIRECT
 	default n
 
Signature · 1 line
2.39.5
#1 lore raw

Hi Arnd,

Quoted 13 lines

When CONFIG_INFINIBAND is set to =m, it is not possible to have SMBDIRECT built-in, and it turns into a loadable module, but this does not prevent CIFS and SMB_SERVER from being built-in, which in turn causes this link error:

ld.lld-22: error: undefined symbol: smbdirect_socket_release

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

referenced by smbdirect.c:212 (fs/smb/client/smbdirect.c:212)
fs/smb/client/smbdirect.o:(smbd_destroy) in archive vmlinux.a
referenced by smbdirect.c:212 (fs/smb/client/smbdirect.c:212)
fs/smb/client/smbdirect.o:(smbd_reconnect) in archive vmlinux.a
referenced by smbdirect.c:338 (fs/smb/client/smbdirect.c:338)
fs/smb/client/smbdirect.o:(smbd_get_connection) in archive vmlinux.a

Quoted 5 lines

Enforce the dependency at Kconfig level, so that the respective smpdirect options are only offered if it's possible to link against the common module and infiniband.

Fixes 28504d6ee127 ("smb: client: make use of smbdirect.ko")

Thanks for the fix!

Steve can you put that an top of ksmbd-for-next for the moment. Then I'll squash the hunks in the correct patch and provide a new branch, as the 2nd would have:

Fixes 30807ad55601 ("smb: server: make use of smbdirect.ko")

But both hashes are unlikely be the ones landing upstream, so as we do rebase anyway I'd squash them, but maybe I'll have time for the rebase after -rc4.

So we should take it as is for now, but maybe without the Fixes tag, but acked by me.

Thanks!
metze

maintainer Acked-by on v1 1/1
#3 lore raw
In reply to Arnd Bergmann
Quoted 16 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

When CONFIG_INFINIBAND is set to =m, it is not possible to have SMBDIRECT built-in, and it turns into a loadable module, but this does not prevent CIFS and SMB_SERVER from being built-in, which in turn causes this link error:

ld.lld-22: error: undefined symbol: smbdirect_socket_release

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

referenced by smbdirect.c:212 (fs/smb/client/smbdirect.c:212)
fs/smb/client/smbdirect.o:(smbd_destroy) in archive vmlinux.a
referenced by smbdirect.c:212 (fs/smb/client/smbdirect.c:212)
fs/smb/client/smbdirect.o:(smbd_reconnect) in archive vmlinux.a
referenced by smbdirect.c:338 (fs/smb/client/smbdirect.c:338)
fs/smb/client/smbdirect.o:(smbd_get_connection) in archive vmlinux.a

Quoted 6 lines

Enforce the dependency at Kconfig level, so that the respective smpdirect options are only offered if it's possible to link against the common module and infiniband.

Fixes 28504d6ee127 ("smb: client: make use of smbdirect.ko")

Thanks!

#2 lore raw
In reply to Stefan Metzmacher

added the acked-by and merged into ksmbd-for-next

Quoted 40 lines · Stefan Metzmacher via samba-technical

Hi Arnd,

Quoted 13 lines

When CONFIG_INFINIBAND is set to =m, it is not possible to have SMBDIRECT built-in, and it turns into a loadable module, but this does not prevent CIFS and SMB_SERVER from being built-in, which in turn causes this link error:

ld.lld-22: error: undefined symbol: smbdirect_socket_release

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

referenced by smbdirect.c:212 (fs/smb/client/smbdirect.c:212)
fs/smb/client/smbdirect.o:(smbd_destroy) in archive vmlinux.a
referenced by smbdirect.c:212 (fs/smb/client/smbdirect.c:212)
fs/smb/client/smbdirect.o:(smbd_reconnect) in archive vmlinux.a
referenced by smbdirect.c:338 (fs/smb/client/smbdirect.c:338)
fs/smb/client/smbdirect.o:(smbd_get_connection) in archive vmlinux.a

Quoted 5 lines

Enforce the dependency at Kconfig level, so that the respective smpdirect options are only offered if it's possible to link against the common module and infiniband.

Fixes 28504d6ee127 ("smb: client: make use of smbdirect.ko")

Thanks for the fix!

Steve can you put that an top of ksmbd-for-next for the moment. Then I'll squash the hunks in the correct patch and provide a new branch, as the 2nd would have:

Fixes 30807ad55601 ("smb: server: make use of smbdirect.ko")

But both hashes are unlikely be the ones landing upstream, so as we do rebase anyway I'd squash them, but maybe I'll have time for the rebase after -rc4.

So we should take it as is for now, but maybe without the Fixes tag, but acked by me.

Thanks!
metze

Signature · 3 lines
Thanks,

Steve