[Midnightbsd-cvs] src [9800] U stable/0.8/sys/rpc: Fix the client isde krpc from doing TCP reconnects for ERESTART for sosend()
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Fri Mar 2 17:02:30 EST 2018
Revision: 9800
http://svnweb.midnightbsd.org/src/?rev=9800
Author: laffer1
Date: 2018-03-02 17:02:29 -0500 (Fri, 02 Mar 2018)
Log Message:
-----------
Fix the client isde krpc from doing TCP reconnects for ERESTART for sosend()
Needed for Amazon EFS
Modified Paths:
--------------
stable/0.8/sys/rpc/clnt_vc.c
Property Changed:
----------------
stable/0.8/sys/rpc/auth.h
stable/0.8/sys/rpc/auth_none.c
stable/0.8/sys/rpc/auth_unix.c
stable/0.8/sys/rpc/authunix_prot.c
stable/0.8/sys/rpc/clnt.h
stable/0.8/sys/rpc/clnt_dg.c
stable/0.8/sys/rpc/clnt_rc.c
stable/0.8/sys/rpc/clnt_stat.h
stable/0.8/sys/rpc/clnt_vc.c
stable/0.8/sys/rpc/getnetconfig.c
stable/0.8/sys/rpc/netconfig.h
stable/0.8/sys/rpc/nettype.h
stable/0.8/sys/rpc/pmap_prot.h
stable/0.8/sys/rpc/replay.c
stable/0.8/sys/rpc/replay.h
stable/0.8/sys/rpc/rpc.h
stable/0.8/sys/rpc/rpc_callmsg.c
stable/0.8/sys/rpc/rpc_com.h
stable/0.8/sys/rpc/rpc_generic.c
stable/0.8/sys/rpc/rpc_msg.h
stable/0.8/sys/rpc/rpc_prot.c
stable/0.8/sys/rpc/rpcb_clnt.c
stable/0.8/sys/rpc/rpcb_clnt.h
stable/0.8/sys/rpc/rpcb_prot.c
stable/0.8/sys/rpc/rpcb_prot.h
stable/0.8/sys/rpc/rpcm_subs.h
stable/0.8/sys/rpc/rpcsec_gss.h
stable/0.8/sys/rpc/svc.c
stable/0.8/sys/rpc/svc.h
stable/0.8/sys/rpc/svc_auth.c
stable/0.8/sys/rpc/svc_auth.h
stable/0.8/sys/rpc/svc_auth_unix.c
stable/0.8/sys/rpc/svc_dg.c
stable/0.8/sys/rpc/svc_generic.c
stable/0.8/sys/rpc/svc_vc.c
stable/0.8/sys/rpc/types.h
stable/0.8/sys/rpc/xdr.h
Index: stable/0.8/sys/rpc/auth.h
===================================================================
--- stable/0.8/sys/rpc/auth.h 2018-03-02 22:01:57 UTC (rev 9799)
+++ stable/0.8/sys/rpc/auth.h 2018-03-02 22:02:29 UTC (rev 9800)
Property changes on: stable/0.8/sys/rpc/auth.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.3
\ No newline at end of property
Index: stable/0.8/sys/rpc/auth_none.c
===================================================================
--- stable/0.8/sys/rpc/auth_none.c 2018-03-02 22:01:57 UTC (rev 9799)
+++ stable/0.8/sys/rpc/auth_none.c 2018-03-02 22:02:29 UTC (rev 9800)
Property changes on: stable/0.8/sys/rpc/auth_none.c
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.3
\ No newline at end of property
Index: stable/0.8/sys/rpc/auth_unix.c
===================================================================
--- stable/0.8/sys/rpc/auth_unix.c 2018-03-02 22:01:57 UTC (rev 9799)
+++ stable/0.8/sys/rpc/auth_unix.c 2018-03-02 22:02:29 UTC (rev 9800)
Property changes on: stable/0.8/sys/rpc/auth_unix.c
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.3
\ No newline at end of property
Index: stable/0.8/sys/rpc/authunix_prot.c
===================================================================
--- stable/0.8/sys/rpc/authunix_prot.c 2018-03-02 22:01:57 UTC (rev 9799)
+++ stable/0.8/sys/rpc/authunix_prot.c 2018-03-02 22:02:29 UTC (rev 9800)
Property changes on: stable/0.8/sys/rpc/authunix_prot.c
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.3
\ No newline at end of property
Index: stable/0.8/sys/rpc/clnt.h
===================================================================
--- stable/0.8/sys/rpc/clnt.h 2018-03-02 22:01:57 UTC (rev 9799)
+++ stable/0.8/sys/rpc/clnt.h 2018-03-02 22:02:29 UTC (rev 9800)
Property changes on: stable/0.8/sys/rpc/clnt.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.3
\ No newline at end of property
Index: stable/0.8/sys/rpc/clnt_dg.c
===================================================================
--- stable/0.8/sys/rpc/clnt_dg.c 2018-03-02 22:01:57 UTC (rev 9799)
+++ stable/0.8/sys/rpc/clnt_dg.c 2018-03-02 22:02:29 UTC (rev 9800)
Property changes on: stable/0.8/sys/rpc/clnt_dg.c
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.3
\ No newline at end of property
Index: stable/0.8/sys/rpc/clnt_rc.c
===================================================================
--- stable/0.8/sys/rpc/clnt_rc.c 2018-03-02 22:01:57 UTC (rev 9799)
+++ stable/0.8/sys/rpc/clnt_rc.c 2018-03-02 22:02:29 UTC (rev 9800)
Property changes on: stable/0.8/sys/rpc/clnt_rc.c
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.3
\ No newline at end of property
Index: stable/0.8/sys/rpc/clnt_stat.h
===================================================================
--- stable/0.8/sys/rpc/clnt_stat.h 2018-03-02 22:01:57 UTC (rev 9799)
+++ stable/0.8/sys/rpc/clnt_stat.h 2018-03-02 22:02:29 UTC (rev 9800)
Property changes on: stable/0.8/sys/rpc/clnt_stat.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.3
\ No newline at end of property
Modified: stable/0.8/sys/rpc/clnt_vc.c
===================================================================
--- stable/0.8/sys/rpc/clnt_vc.c 2018-03-02 22:01:57 UTC (rev 9799)
+++ stable/0.8/sys/rpc/clnt_vc.c 2018-03-02 22:02:29 UTC (rev 9800)
@@ -58,6 +58,7 @@
#include <sys/param.h>
#include <sys/systm.h>
+#include <sys/kernel.h>
#include <sys/lock.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
@@ -106,6 +107,8 @@
.cl_control = clnt_vc_control
};
+static int fake_wchan;
+
/*
* A pending RPC request which awaits a reply. Requests which have
* received their reply will have cr_xid set to zero and cr_mrep to
@@ -345,7 +348,7 @@
uint32_t xid;
struct mbuf *mreq = NULL, *results;
struct ct_request *cr;
- int error;
+ int error, trycnt;
cr = malloc(sizeof(struct ct_request), M_RPC, M_WAITOK);
@@ -375,8 +378,20 @@
timeout = ct->ct_wait; /* use default timeout */
}
+ /*
+ * After 15sec of looping, allow it to return RPC_CANTSEND, which will
+ * cause the clnt_reconnect layer to create a new TCP connection.
+ */
+ trycnt = 15 * hz;
call_again:
mtx_assert(&ct->ct_lock, MA_OWNED);
+ if (ct->ct_closing || ct->ct_closed) {
+ ct->ct_threads--;
+ wakeup(ct);
+ mtx_unlock(&ct->ct_lock);
+ free(cr, M_RPC);
+ return (RPC_CANTSEND);
+ }
ct->ct_xid++;
xid = ct->ct_xid;
@@ -444,7 +459,8 @@
*/
error = sosend(ct->ct_socket, NULL, NULL, mreq, NULL, 0, curthread);
mreq = NULL;
- if (error == EMSGSIZE) {
+ if (error == EMSGSIZE || (error == ERESTART &&
+ (ct->ct_waitflag & PCATCH) == 0 && trycnt-- > 0)) {
SOCKBUF_LOCK(&ct->ct_socket->so_snd);
sbwait(&ct->ct_socket->so_snd);
SOCKBUF_UNLOCK(&ct->ct_socket->so_snd);
@@ -451,6 +467,8 @@
AUTH_VALIDATE(auth, xid, NULL, NULL);
mtx_lock(&ct->ct_lock);
TAILQ_REMOVE(&ct->ct_pending, cr, cr_link);
+ /* Sleep for 1 clock tick before trying the sosend() again. */
+ msleep(&fake_wchan, &ct->ct_lock, 0, "rpclpsnd", 1);
goto call_again;
}
@@ -836,6 +854,10 @@
soclose(so);
}
mem_free(ct, sizeof(struct ct_data));
+ if (cl->cl_netid && cl->cl_netid[0])
+ mem_free(cl->cl_netid, strlen(cl->cl_netid) +1);
+ if (cl->cl_tp && cl->cl_tp[0])
+ mem_free(cl->cl_tp, strlen(cl->cl_tp) +1);
mem_free(cl, sizeof(CLIENT));
}
Property changes on: stable/0.8/sys/rpc/clnt_vc.c
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.3
\ No newline at end of property
Index: stable/0.8/sys/rpc/getnetconfig.c
===================================================================
--- stable/0.8/sys/rpc/getnetconfig.c 2018-03-02 22:01:57 UTC (rev 9799)
+++ stable/0.8/sys/rpc/getnetconfig.c 2018-03-02 22:02:29 UTC (rev 9800)
Property changes on: stable/0.8/sys/rpc/getnetconfig.c
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.3
\ No newline at end of property
Index: stable/0.8/sys/rpc/netconfig.h
===================================================================
--- stable/0.8/sys/rpc/netconfig.h 2018-03-02 22:01:57 UTC (rev 9799)
+++ stable/0.8/sys/rpc/netconfig.h 2018-03-02 22:02:29 UTC (rev 9800)
Property changes on: stable/0.8/sys/rpc/netconfig.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.3
\ No newline at end of property
Index: stable/0.8/sys/rpc/nettype.h
===================================================================
--- stable/0.8/sys/rpc/nettype.h 2018-03-02 22:01:57 UTC (rev 9799)
+++ stable/0.8/sys/rpc/nettype.h 2018-03-02 22:02:29 UTC (rev 9800)
Property changes on: stable/0.8/sys/rpc/nettype.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.3
\ No newline at end of property
Index: stable/0.8/sys/rpc/pmap_prot.h
===================================================================
--- stable/0.8/sys/rpc/pmap_prot.h 2018-03-02 22:01:57 UTC (rev 9799)
+++ stable/0.8/sys/rpc/pmap_prot.h 2018-03-02 22:02:29 UTC (rev 9800)
Property changes on: stable/0.8/sys/rpc/pmap_prot.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.3
\ No newline at end of property
Index: stable/0.8/sys/rpc/replay.c
===================================================================
--- stable/0.8/sys/rpc/replay.c 2018-03-02 22:01:57 UTC (rev 9799)
+++ stable/0.8/sys/rpc/replay.c 2018-03-02 22:02:29 UTC (rev 9800)
Property changes on: stable/0.8/sys/rpc/replay.c
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.2
\ No newline at end of property
Index: stable/0.8/sys/rpc/replay.h
===================================================================
--- stable/0.8/sys/rpc/replay.h 2018-03-02 22:01:57 UTC (rev 9799)
+++ stable/0.8/sys/rpc/replay.h 2018-03-02 22:02:29 UTC (rev 9800)
Property changes on: stable/0.8/sys/rpc/replay.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.2
\ No newline at end of property
Index: stable/0.8/sys/rpc/rpc.h
===================================================================
--- stable/0.8/sys/rpc/rpc.h 2018-03-02 22:01:57 UTC (rev 9799)
+++ stable/0.8/sys/rpc/rpc.h 2018-03-02 22:02:29 UTC (rev 9800)
Property changes on: stable/0.8/sys/rpc/rpc.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.3
\ No newline at end of property
Index: stable/0.8/sys/rpc/rpc_callmsg.c
===================================================================
--- stable/0.8/sys/rpc/rpc_callmsg.c 2018-03-02 22:01:57 UTC (rev 9799)
+++ stable/0.8/sys/rpc/rpc_callmsg.c 2018-03-02 22:02:29 UTC (rev 9800)
Property changes on: stable/0.8/sys/rpc/rpc_callmsg.c
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.3
\ No newline at end of property
Index: stable/0.8/sys/rpc/rpc_com.h
===================================================================
--- stable/0.8/sys/rpc/rpc_com.h 2018-03-02 22:01:57 UTC (rev 9799)
+++ stable/0.8/sys/rpc/rpc_com.h 2018-03-02 22:02:29 UTC (rev 9800)
Property changes on: stable/0.8/sys/rpc/rpc_com.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.3
\ No newline at end of property
Index: stable/0.8/sys/rpc/rpc_generic.c
===================================================================
--- stable/0.8/sys/rpc/rpc_generic.c 2018-03-02 22:01:57 UTC (rev 9799)
+++ stable/0.8/sys/rpc/rpc_generic.c 2018-03-02 22:02:29 UTC (rev 9800)
Property changes on: stable/0.8/sys/rpc/rpc_generic.c
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.3
\ No newline at end of property
Index: stable/0.8/sys/rpc/rpc_msg.h
===================================================================
--- stable/0.8/sys/rpc/rpc_msg.h 2018-03-02 22:01:57 UTC (rev 9799)
+++ stable/0.8/sys/rpc/rpc_msg.h 2018-03-02 22:02:29 UTC (rev 9800)
Property changes on: stable/0.8/sys/rpc/rpc_msg.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.3
\ No newline at end of property
Index: stable/0.8/sys/rpc/rpc_prot.c
===================================================================
--- stable/0.8/sys/rpc/rpc_prot.c 2018-03-02 22:01:57 UTC (rev 9799)
+++ stable/0.8/sys/rpc/rpc_prot.c 2018-03-02 22:02:29 UTC (rev 9800)
Property changes on: stable/0.8/sys/rpc/rpc_prot.c
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.3
\ No newline at end of property
Index: stable/0.8/sys/rpc/rpcb_clnt.c
===================================================================
--- stable/0.8/sys/rpc/rpcb_clnt.c 2018-03-02 22:01:57 UTC (rev 9799)
+++ stable/0.8/sys/rpc/rpcb_clnt.c 2018-03-02 22:02:29 UTC (rev 9800)
Property changes on: stable/0.8/sys/rpc/rpcb_clnt.c
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.3
\ No newline at end of property
Index: stable/0.8/sys/rpc/rpcb_clnt.h
===================================================================
--- stable/0.8/sys/rpc/rpcb_clnt.h 2018-03-02 22:01:57 UTC (rev 9799)
+++ stable/0.8/sys/rpc/rpcb_clnt.h 2018-03-02 22:02:29 UTC (rev 9800)
Property changes on: stable/0.8/sys/rpc/rpcb_clnt.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.3
\ No newline at end of property
Index: stable/0.8/sys/rpc/rpcb_prot.c
===================================================================
--- stable/0.8/sys/rpc/rpcb_prot.c 2018-03-02 22:01:57 UTC (rev 9799)
+++ stable/0.8/sys/rpc/rpcb_prot.c 2018-03-02 22:02:29 UTC (rev 9800)
Property changes on: stable/0.8/sys/rpc/rpcb_prot.c
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.3
\ No newline at end of property
Index: stable/0.8/sys/rpc/rpcb_prot.h
===================================================================
--- stable/0.8/sys/rpc/rpcb_prot.h 2018-03-02 22:01:57 UTC (rev 9799)
+++ stable/0.8/sys/rpc/rpcb_prot.h 2018-03-02 22:02:29 UTC (rev 9800)
Property changes on: stable/0.8/sys/rpc/rpcb_prot.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.3
\ No newline at end of property
Index: stable/0.8/sys/rpc/rpcm_subs.h
===================================================================
--- stable/0.8/sys/rpc/rpcm_subs.h 2018-03-02 22:01:57 UTC (rev 9799)
+++ stable/0.8/sys/rpc/rpcm_subs.h 2018-03-02 22:02:29 UTC (rev 9800)
Property changes on: stable/0.8/sys/rpc/rpcm_subs.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5
\ No newline at end of property
Index: stable/0.8/sys/rpc/rpcsec_gss.h
===================================================================
--- stable/0.8/sys/rpc/rpcsec_gss.h 2018-03-02 22:01:57 UTC (rev 9799)
+++ stable/0.8/sys/rpc/rpcsec_gss.h 2018-03-02 22:02:29 UTC (rev 9800)
Property changes on: stable/0.8/sys/rpc/rpcsec_gss.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.2
\ No newline at end of property
Index: stable/0.8/sys/rpc/svc.c
===================================================================
--- stable/0.8/sys/rpc/svc.c 2018-03-02 22:01:57 UTC (rev 9799)
+++ stable/0.8/sys/rpc/svc.c 2018-03-02 22:02:29 UTC (rev 9800)
Property changes on: stable/0.8/sys/rpc/svc.c
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.3
\ No newline at end of property
Index: stable/0.8/sys/rpc/svc.h
===================================================================
--- stable/0.8/sys/rpc/svc.h 2018-03-02 22:01:57 UTC (rev 9799)
+++ stable/0.8/sys/rpc/svc.h 2018-03-02 22:02:29 UTC (rev 9800)
Property changes on: stable/0.8/sys/rpc/svc.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.3
\ No newline at end of property
Index: stable/0.8/sys/rpc/svc_auth.c
===================================================================
--- stable/0.8/sys/rpc/svc_auth.c 2018-03-02 22:01:57 UTC (rev 9799)
+++ stable/0.8/sys/rpc/svc_auth.c 2018-03-02 22:02:29 UTC (rev 9800)
Property changes on: stable/0.8/sys/rpc/svc_auth.c
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.3
\ No newline at end of property
Index: stable/0.8/sys/rpc/svc_auth.h
===================================================================
--- stable/0.8/sys/rpc/svc_auth.h 2018-03-02 22:01:57 UTC (rev 9799)
+++ stable/0.8/sys/rpc/svc_auth.h 2018-03-02 22:02:29 UTC (rev 9800)
Property changes on: stable/0.8/sys/rpc/svc_auth.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.3
\ No newline at end of property
Index: stable/0.8/sys/rpc/svc_auth_unix.c
===================================================================
--- stable/0.8/sys/rpc/svc_auth_unix.c 2018-03-02 22:01:57 UTC (rev 9799)
+++ stable/0.8/sys/rpc/svc_auth_unix.c 2018-03-02 22:02:29 UTC (rev 9800)
Property changes on: stable/0.8/sys/rpc/svc_auth_unix.c
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.3
\ No newline at end of property
Index: stable/0.8/sys/rpc/svc_dg.c
===================================================================
--- stable/0.8/sys/rpc/svc_dg.c 2018-03-02 22:01:57 UTC (rev 9799)
+++ stable/0.8/sys/rpc/svc_dg.c 2018-03-02 22:02:29 UTC (rev 9800)
Property changes on: stable/0.8/sys/rpc/svc_dg.c
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.3
\ No newline at end of property
Index: stable/0.8/sys/rpc/svc_generic.c
===================================================================
--- stable/0.8/sys/rpc/svc_generic.c 2018-03-02 22:01:57 UTC (rev 9799)
+++ stable/0.8/sys/rpc/svc_generic.c 2018-03-02 22:02:29 UTC (rev 9800)
Property changes on: stable/0.8/sys/rpc/svc_generic.c
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.3
\ No newline at end of property
Index: stable/0.8/sys/rpc/svc_vc.c
===================================================================
--- stable/0.8/sys/rpc/svc_vc.c 2018-03-02 22:01:57 UTC (rev 9799)
+++ stable/0.8/sys/rpc/svc_vc.c 2018-03-02 22:02:29 UTC (rev 9800)
Property changes on: stable/0.8/sys/rpc/svc_vc.c
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.3
\ No newline at end of property
Index: stable/0.8/sys/rpc/types.h
===================================================================
--- stable/0.8/sys/rpc/types.h 2018-03-02 22:01:57 UTC (rev 9799)
+++ stable/0.8/sys/rpc/types.h 2018-03-02 22:02:29 UTC (rev 9800)
Property changes on: stable/0.8/sys/rpc/types.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.5
\ No newline at end of property
Index: stable/0.8/sys/rpc/xdr.h
===================================================================
--- stable/0.8/sys/rpc/xdr.h 2018-03-02 22:01:57 UTC (rev 9799)
+++ stable/0.8/sys/rpc/xdr.h 2018-03-02 22:02:29 UTC (rev 9800)
Property changes on: stable/0.8/sys/rpc/xdr.h
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.3
\ No newline at end of property
More information about the Midnightbsd-cvs
mailing list