aboutsummaryrefslogtreecommitdiff
path: root/sys/nfsclient/nfs_vfsops.c
diff options
context:
space:
mode:
authorRick Macklem <rmacklem@FreeBSD.org>2012-01-31 03:58:26 +0000
committerRick Macklem <rmacklem@FreeBSD.org>2012-01-31 03:58:26 +0000
commit87b633678b1858c8621bf0a93e4b46774dbaa8d1 (patch)
treeedde3b27bc3c9153830fe3d6ac664ff710d44eef /sys/nfsclient/nfs_vfsops.c
parenta8122d16b5f4f1a061d2bf05fc8577fd5902f2bf (diff)
downloadsrc-87b633678b1858c8621bf0a93e4b46774dbaa8d1.tar.gz
src-87b633678b1858c8621bf0a93e4b46774dbaa8d1.zip
When a "mount -u" switches an NFS mount point from TCP to UDP,
any thread doing an I/O RPC with a transfer size greater than NFS_UDPMAXDATA will be hung indefinitely, retrying the RPC. After a discussion on freebsd-fs@, I decided to add a warning message for this case, as suggested by Jeremy Chadwick. Suggested by: freebsd at jdc.parodius.com (Jeremy Chadwick) MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=230803
Diffstat (limited to 'sys/nfsclient/nfs_vfsops.c')
-rw-r--r--sys/nfsclient/nfs_vfsops.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c
index 82891f9e29f8..58384e86a1bf 100644
--- a/sys/nfsclient/nfs_vfsops.c
+++ b/sys/nfsclient/nfs_vfsops.c
@@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$");
#include <sys/socketvar.h>
#include <sys/sockio.h>
#include <sys/sysctl.h>
+#include <sys/syslog.h>
#include <sys/vnode.h>
#include <sys/signalvar.h>
@@ -1116,6 +1117,19 @@ nfs_mount(struct mount *mp)
error = EIO;
goto out;
}
+
+ /*
+ * If a change from TCP->UDP is done and there are thread(s)
+ * that have I/O RPC(s) in progress with a tranfer size
+ * greater than NFS_MAXDGRAMDATA, those thread(s) will be
+ * hung, retrying the RPC(s) forever. Usually these threads
+ * will be seen doing an uninterruptible sleep on wait channel
+ * "newnfsreq" (truncated to "newnfsre" by procstat).
+ */
+ if (args.sotype == SOCK_DGRAM && nmp->nm_sotype == SOCK_STREAM)
+ tprintf(curthread->td_proc, LOG_WARNING,
+ "Warning: mount -u that changes TCP->UDP can result in hung threads\n");
+
/*
* When doing an update, we can't change from or to
* v3, switch lockd strategies or change cookie translation