summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkris <kris@FreeBSD.org>2008-02-11 23:23:21 +0000
committerkris <kris@FreeBSD.org>2008-02-11 23:23:21 +0000
commit989a96d5cb275865259133d5282761b7a4bf0de8 (patch)
tree57916269ae94baf4c1e5e8e07c685703b778cbc7
parente3f122733ae5a2ff4d38fe7d3a3da82749c22f68 (diff)
downloadFreeBSD-src-989a96d5cb275865259133d5282761b7a4bf0de8.zip
FreeBSD-src-989a96d5cb275865259133d5282761b7a4bf0de8.tar.gz
Switch the default NFS mount mode from UDP to TCP. UDP mounts are a
historical relic, and are no longer appropriate for either LAN or WAN mounting. At modern (gigabit and 10 gigabit) LAN speeds packet loss from socket buffer fill events is common, and sequence numbers wrap quickly enough that data corruption is possible. TCP solves both of these problems without imposing significant overhead. MFC after: 1 month
-rw-r--r--UPDATING6
-rw-r--r--sbin/mount_nfs/mount_nfs.810
-rw-r--r--sbin/mount_nfs/mount_nfs.c2
-rw-r--r--sys/nfsclient/nfs_diskless.c4
4 files changed, 14 insertions, 8 deletions
diff --git a/UPDATING b/UPDATING
index 24e8cd1..10ea7e3 100644
--- a/UPDATING
+++ b/UPDATING
@@ -22,6 +22,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8.x IS SLOW:
to maximize performance. (To disable malloc debugging, run
ln -s aj /etc/malloc.conf.)
+20080211:
+ The default NFS mount mode has changed from UDP to TCP for
+ increased reliability. If you rely on (insecurely) NFS
+ mounting across a firewall you may need to update your
+ firewall rules.
+
20080208:
Belatedly note the addition of m_collapse for compacting
mbuf chains.
diff --git a/sbin/mount_nfs/mount_nfs.8 b/sbin/mount_nfs/mount_nfs.8
index 93ea3c2..a8d410f 100644
--- a/sbin/mount_nfs/mount_nfs.8
+++ b/sbin/mount_nfs/mount_nfs.8
@@ -142,11 +142,11 @@ The default is a retry count of zero, which means to keep retrying
forever.
There is a 60 second delay between each attempt.
.It Fl T
-Use TCP transport instead of UDP.
-This is recommended for servers that are not on the same LAN cable as
-the client.
-Not all NFS servers support this method, especially older ones;
-caution should be observed in these cases.
+Use TCP transport.
+This is the default option, as it provides for increased reliability on both
+LAN and WAN configurations compared to UDP.
+Some old NFS servers do not support this method; UDP mounts may be required
+for interoperability.
.It Fl U
Force the mount protocol to use UDP transport, even for TCP NFS mounts.
(Necessary for some old
diff --git a/sbin/mount_nfs/mount_nfs.c b/sbin/mount_nfs/mount_nfs.c
index 44d45e8..48c0a1f 100644
--- a/sbin/mount_nfs/mount_nfs.c
+++ b/sbin/mount_nfs/mount_nfs.c
@@ -155,7 +155,7 @@ struct nfs_args nfsdefargs = {
NFS_ARGSVERSION,
NULL,
sizeof (struct sockaddr_in),
- SOCK_DGRAM,
+ SOCK_STREAM,
0,
NULL,
0,
diff --git a/sys/nfsclient/nfs_diskless.c b/sys/nfsclient/nfs_diskless.c
index 4825d31..a970b1d 100644
--- a/sys/nfsclient/nfs_diskless.c
+++ b/sys/nfsclient/nfs_diskless.c
@@ -204,8 +204,8 @@ match_done:
/* set up root mount */
nd->root_args.rsize = 8192; /* XXX tunable? */
nd->root_args.wsize = 8192;
- nd->root_args.sotype = SOCK_DGRAM;
- nd->root_args.flags = (NFSMNT_WSIZE | NFSMNT_RSIZE | NFSMNT_RESVPORT);
+ nd->root_args.sotype = SOCK_STREAM;
+ nd->root_args.flags = (NFSMNT_NFSV3 | NFSMNT_WSIZE | NFSMNT_RSIZE | NFSMNT_RESVPORT);
if (inaddr_to_sockaddr("boot.nfsroot.server", &nd->root_saddr)) {
printf("nfs_diskless: no server\n");
return;
OpenPOWER on IntegriCloud