Fix build failure of OCFS2 when TCP/IP is disabled
Subsystems (3)
PATCH 1/1 Fix build failure of OCFS2 when TCP/IP is disabled
After commit 12abc5ee7873 ("tcp: add tcp_sock_set_nodelay") and commit c488aeadcbd0 ("tcp: add tcp_sock_set_user_timeout"), building the kernel with OCFS2_FS=y but without INET=y causes it to fail with:
ld: fs/ocfs2/cluster/tcp.o: in function `o2net_accept_many':
tcp.c:(.text+0x21b1): undefined reference to `tcp_sock_set_nodelay'
ld: tcp.c:(.text+0x21c1): undefined reference to `tcp_sock_set_user_timeout '
ld: fs/ocfs2/cluster/tcp.o: in function `o2net_start_connect':
tcp.c:(.text+0x2633): undefined reference to `tcp_sock_set_nodelay'
ld: tcp.c:(.text+0x2643): undefined reference to `tcp_sock_set_user_timeout '
This is due to tcp_sock_set_nodelay() and tcp_sock_set_user_timeout() being declared in linux/tcp.h and defined in net/ipv4/tcp.c, which depend on TCP/IP being enabled.
To fix this, make OCFS2_FS depend on INET=y which already requires NET=y.
--- fs/ocfs2/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ocfs2/Kconfig +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-only config OCFS2_FS tristate "OCFS2 file system support" - depends on NET && SYSFS && CONFIGFS_FS + depends on INET && SYSFS && CONFIGFS_FS select JBD2 select CRC32 select QUOTA
Signature · 1 line
2.20.1
Quoted 13 lines · Tom Seewald
After commit
12abc5ee7873("tcp: addtcp_sock_set_nodelay") and commitc488aeadcbd0("tcp: addtcp_sock_set_user_timeout"), building the kernel with OCFS2_FS=y but without INET=y causes it to fail with:ld:
fs/ocfs2/cluster/tcp.o: in function `o2net_accept_many':
tcp.c:(.text+0x21b1): undefined reference to `tcp_sock_set_nodelay'
ld: tcp.c:(.text+0x21c1): undefined reference to `tcp_sock_set_user_timeout '
ld:fs/ocfs2/cluster/tcp.o: in function `o2net_start_connect':
tcp.c:(.text+0x2633): undefined reference to `tcp_sock_set_nodelay'
ld: tcp.c:(.text+0x2643): undefined reference to `tcp_sock_set_user_timeout '
Quoted 7 lines
This is due to
tcp_sock_set_nodelay()andtcp_sock_set_user_timeout()being declared inlinux/tcp.hand defined innet/ipv4/tcp.c, which depend on TCP/IP being enabled.To fix this, make
OCFS2_FSdepend on INET=y which already requires NET=y.Signed-off-by Tom Seewald <[email protected]>
Quoted 18 lines
--- fs/ocfs2/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/ocfs2/Kconfig +1
-1@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-only config OCFS2_FS tristate "OCFS2 file system support" - depends on NET && SYSFS && CONFIGFS_FS + depends on INET && SYSFS && CONFIGFS_FS select JBD2 select CRC32 select QUOTA
Quoted 13 lines · Tom Seewald
After commit
12abc5ee7873("tcp: addtcp_sock_set_nodelay") and commitc488aeadcbd0("tcp: addtcp_sock_set_user_timeout"), building the kernel with OCFS2_FS=y but without INET=y causes it to fail with:ld:
fs/ocfs2/cluster/tcp.o: in function `o2net_accept_many':
tcp.c:(.text+0x21b1): undefined reference to `tcp_sock_set_nodelay'
ld: tcp.c:(.text+0x21c1): undefined reference to `tcp_sock_set_user_timeout '
ld:fs/ocfs2/cluster/tcp.o: in function `o2net_start_connect':
tcp.c:(.text+0x2633): undefined reference to `tcp_sock_set_nodelay'
ld: tcp.c:(.text+0x2643): undefined reference to `tcp_sock_set_user_timeout '
Quoted 7 lines
This is due to
tcp_sock_set_nodelay()andtcp_sock_set_user_timeout()being declared inlinux/tcp.hand defined innet/ipv4/tcp.c, which depend on TCP/IP being enabled.To fix this, make
OCFS2_FSdepend on INET=y which already requires NET=y.Signed-off-by Tom Seewald <[email protected]>
Looks good, and this is the same that I did for nfsd: