summaryrefslogtreecommitdiffstats
path: root/sys/rpc
diff options
context:
space:
mode:
authorrmacklem <rmacklem@FreeBSD.org>2009-11-08 19:02:13 +0000
committerrmacklem <rmacklem@FreeBSD.org>2009-11-08 19:02:13 +0000
commit8cad35127a89189a6ea7233767281695887cc3d8 (patch)
tree3223e603fb5d7cdcca0aee3881837197f73021ed /sys/rpc
parentf4274f9678e4ce496e30c73d5889107ff757b668 (diff)
downloadFreeBSD-src-8cad35127a89189a6ea7233767281695887cc3d8.zip
FreeBSD-src-8cad35127a89189a6ea7233767281695887cc3d8.tar.gz
Add a check for the connection being shut down to the krpc
client just before queuing a request for the connection. The code already had a check for the connection being shut down while the request was queued, but not one for the shut down having been initiated by the server before the request was in the queue. This appears to fix the problem of slow reconnects against an NFS server that drops inactive connections reported by Olaf Seibert, but does not fix the case where the FreeBSD client generates RST segments at about the same time as ACKs. This is still a problem that is being investigated. This patch does not cause a regression for this case. Tested by: Olaf Seibert, Daniel Braniss Reviewed by: dfr MFC after: 5 days
Diffstat (limited to 'sys/rpc')
-rw-r--r--sys/rpc/clnt_vc.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/sys/rpc/clnt_vc.c b/sys/rpc/clnt_vc.c
index 85e89ab..2e5fe41 100644
--- a/sys/rpc/clnt_vc.c
+++ b/sys/rpc/clnt_vc.c
@@ -413,6 +413,22 @@ call_again:
cr->cr_xid = xid;
mtx_lock(&ct->ct_lock);
+ /*
+ * Check to see if the other end has already started to close down
+ * the connection. The upcall will have set ct_error.re_status
+ * to RPC_CANTRECV if this is the case.
+ * If the other end starts to close down the connection after this
+ * point, it will be detected later when cr_error is checked,
+ * since the request is in the ct_pending queue.
+ */
+ if (ct->ct_error.re_status == RPC_CANTRECV) {
+ if (errp != &ct->ct_error) {
+ errp->re_errno = ct->ct_error.re_errno;
+ errp->re_status = RPC_CANTRECV;
+ }
+ stat = RPC_CANTRECV;
+ goto out;
+ }
TAILQ_INSERT_TAIL(&ct->ct_pending, cr, cr_link);
mtx_unlock(&ct->ct_lock);
OpenPOWER on IntegriCloud