Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Mar 2021 22:14:20 +0000
From:      Rick Macklem <rmacklem@uoguelph.ca>
To:        "freebsd-current@freebsd.org" <freebsd-current@freebsd.org>
Cc:        Alexander Motin <mav@FreeBSD.org>, Peter Eriksson <pen@lysator.liu.se>, Garrett Wollman <wollman@hergotha.csail.mit.edu>
Subject:   testers for NFS server patch needed
Message-ID:  <YQXPR0101MB0968F25AD458BC91F163025FDD649@YQXPR0101MB0968.CANPRD01.PROD.OUTLOOK.COM>

index | next in thread | raw e-mail

[-- Attachment #1 --]
Hi,

A thread over on freebsd-net@ discusses a situation where
Linux clients seem to get stuck when the TCP connection
is partially torn down. (FIN_WAIT_2 on the client and
CLOSE_WAIT on the server.)
The thread is here:
http://docs.FreeBSD.org/cgi/mid.cgi?YQXPR0101MB0968FB1FF0FC481CE37E9A81DD649

Although the underlying cause is not known, I think that
the attached patch, which adds soshutdown(...SHUT_WR)
calls where the socket is no longer useful, might fix the problem/

If you have a FreeBSD NFS server (especially if you have Linux
clients) where you can patch the server, please try the attached
patch and let me know how it goes.

rick


[-- Attachment #2 --]
--- sys/rpc/svc.c.xprtdied	2021-03-20 13:36:50.798335000 -0700
+++ sys/rpc/svc.c	2021-03-20 17:30:41.448270000 -0700
@@ -203,6 +203,8 @@ svcpool_cleanup(SVCPOOL *pool)
 		mtx_unlock(&grp->sg_lock);
 	}
 	TAILQ_FOREACH_SAFE(xprt, &cleanup, xp_link, nxprt) {
+		if (xprt->xp_socket != NULL)
+			soshutdown(xprt->xp_socket, SHUT_WR);
 		SVC_RELEASE(xprt);
 	}
 
@@ -388,6 +390,8 @@ xprt_unregister(SVCXPRT *xprt)
 	xprt_unregister_locked(xprt);
 	mtx_unlock(&grp->sg_lock);
 
+	if (xprt->xp_socket != NULL)
+		soshutdown(xprt->xp_socket, SHUT_WR);
 	SVC_RELEASE(xprt);
 }
 
@@ -1078,6 +1082,7 @@ svc_checkidle(SVCGROUP *grp)
 
 	mtx_unlock(&grp->sg_lock);
 	TAILQ_FOREACH_SAFE(xprt, &cleanup, xp_link, nxprt) {
+		soshutdown(xprt->xp_socket, SHUT_WR);
 		SVC_RELEASE(xprt);
 	}
 	mtx_lock(&grp->sg_lock);
help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?YQXPR0101MB0968F25AD458BC91F163025FDD649>