OpenCloudOS-Kernel/net/sunrpc
Meena Shanmugam 0ba47fb306 SUNRPC: Ensure we flush any closed sockets before xs_xprt_free()
From: Trond Myklebust <trond.myklebust@hammerspace.com>

commit f00432063d upstream.

We must ensure that all sockets are closed before we call xprt_free()
and release the reference to the net namespace. The problem is that
calling fput() will defer closing the socket until delayed_fput() gets
called.
Let's fix the situation by allowing rpciod and the transport teardown
code (which runs on the system wq) to call __fput_sync(), and directly
close the socket.

Reported-by: Felix Fu <foyjog@gmail.com>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Fixes: a73881c96d ("SUNRPC: Fix an Oops in udp_poll()")
Cc: stable@vger.kernel.org # 5.1.x: 3be232f11a3c: SUNRPC: Prevent immediate close+reconnect
Cc: stable@vger.kernel.org # 5.1.x: 89f42494f92f: SUNRPC: Don't call connect() more than once on a TCP socket
Cc: stable@vger.kernel.org # 5.1.x
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
[meenashanmugam: Fix merge conflict in xprt_connect]
Signed-off-by: Meena Shanmugam <meenashanmugam@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-06-11 20:43:56 +08:00
..
auth_gss ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
xprtrdma ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
Kconfig SUNRPC: Drop redundant CONFIG_ from CONFIG_SUNRPC_DISABLE_INSECURE_ENCTYPES 2019-07-06 14:54:53 -04:00
Makefile SUNRPC: remove generic cred code. 2018-12-19 13:52:46 -05:00
addr.c ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
auth.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
auth_null.c SUNRPC: Add rpc_auth::au_ralign field 2019-02-14 11:48:36 -05:00
auth_unix.c SUNRPC: Use the client user namespace when encoding creds 2019-04-26 16:24:32 -04:00
backchannel_rqst.c SUNRPC: Destroy the back channel when we destroy the host transport 2019-10-30 12:04:35 -04:00
cache.c tkernel: add base tlinux kernel interfaces 2024-06-11 20:09:33 +08:00
clnt.c ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
debugfs.c ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
netns.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
rpc_pipe.c ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
rpcb_clnt.c ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
sched.c ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
socklib.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
stats.c Merge branch 'multipath_tcp' 2019-07-06 14:54:52 -04:00
sunrpc.h ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
sunrpc_syms.c ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
svc.c ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
svc_xprt.c ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
svcauth.c ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
svcauth_unix.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
svcsock.c ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
sysctl.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
timer.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
xdr.c ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
xprt.c SUNRPC: Ensure we flush any closed sockets before xs_xprt_free() 2024-06-11 20:43:56 +08:00
xprtmultipath.c SUNRPC: Optimise transport balancing code 2019-07-18 14:43:52 -04:00
xprtsock.c SUNRPC: Ensure we flush any closed sockets before xs_xprt_free() 2024-06-11 20:43:56 +08:00