freebsd-nq/sys/rpc
Rick Macklem db8c27f499 nfsd: fix a NFSv4.1 Linux client mount stuck in CLOSE_WAIT
It was reported that a NFSv4.1 Linux client mount against
a FreeBSD12 server was hung, with the TCP connection in
CLOSE_WAIT state on the server.
When a NFSv4.1/4.2 mount is done and the back channel is
bound to the TCP connection, the soclose() is delayed until
a new TCP connection is bound to the back channel, due to
a reference count being held on the SVCXPRT structure in
the krpc for the socket. Without the soclose() call, the socket
will remain in CLOSE_WAIT and this somehow caused the Linux
client to hang.

This patch adds calls to soshutdown(.., SHUT_WR) that
are performed when the server side krpc sees that the
socket is no longer usable.  Since this can be done
before the back channel is bound to a new TCP connection,
it allows the TCP connection to proceed to CLOSED state.

PR:	254590
Reported by:	jbreitman@tildenparkcapital.com
Reviewed by:	tuexen
Comments by:	kevans
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D29526
2021-04-27 15:32:35 -07:00
..
rpcsec_gss
rpcsec_tls nfs-over-tls: handle res.gid.gid_val correctly for memory allocation 2021-01-12 13:59:52 -08:00
auth_none.c
auth_unix.c
auth.h Add TLS support to the kernel RPC. 2020-08-22 03:57:55 +00:00
authunix_prot.c
clnt_bck.c Add TLS support to the kernel RPC. 2020-08-22 03:57:55 +00:00
clnt_dg.c Change the xid for client side krpc over UDP to a global value. 2020-04-05 21:08:17 +00:00
clnt_rc.c nfsv4 client: do the BindConnectionToSession as required 2021-04-11 14:34:57 -07:00
clnt_stat.h
clnt_vc.c Add TLS support to the kernel RPC. 2020-08-22 03:57:55 +00:00
clnt.h nfsv4 client: do the BindConnectionToSession as required 2021-04-11 14:34:57 -07:00
getnetconfig.c
krpc.h nfsv4 client: do the BindConnectionToSession as required 2021-04-11 14:34:57 -07:00
netconfig.h
nettype.h
pmap_prot.h
replay.c
replay.h
rpc_callmsg.c
rpc_com.h
rpc_generic.c Add TLS support to the kernel RPC. 2020-08-22 03:57:55 +00:00
rpc_msg.h
rpc_prot.c Move M_RPC malloc type into XDR. Both RPC and XDR libraries use 2020-04-17 06:02:13 +00:00
rpc.h
rpcb_clnt.c
rpcb_clnt.h
rpcb_prot.c
rpcb_prot.h
rpcm_subs.h
rpcsec_gss.h
rpcsec_tls.h Add a new "tlscertname" NFS mount option. 2020-12-23 13:42:55 -08:00
svc_auth_unix.c
svc_auth.c Add TLS support to the kernel RPC. 2020-08-22 03:57:55 +00:00
svc_auth.h
svc_dg.c
svc_generic.c
svc_vc.c Add TLS support to the kernel RPC. 2020-08-22 03:57:55 +00:00
svc.c nfsd: fix a NFSv4.1 Linux client mount stuck in CLOSE_WAIT 2021-04-27 15:32:35 -07:00
svc.h Add TLS support to the kernel RPC. 2020-08-22 03:57:55 +00:00
types.h
xdr.h