svn commit: r229172 - stable/9/sys/fs/nfsclient

Rick Macklem rmacklem at FreeBSD.org
Sun Jan 1 16:41:33 UTC 2012


Author: rmacklem
Date: Sun Jan  1 16:41:33 2012
New Revision: 229172
URL: http://svn.freebsd.org/changeset/base/229172

Log:
  MFC: r227493
  Move the assignment of default values for some mount options
  to before the nfs_decode_args() call in the new NFS client,
  so they don't overwrite the value specified on the command line.

Modified:
  stable/9/sys/fs/nfsclient/nfs_clvfsops.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/fs/nfsclient/nfs_clvfsops.c
==============================================================================
--- stable/9/sys/fs/nfsclient/nfs_clvfsops.c	Sun Jan  1 16:05:36 2012	(r229171)
+++ stable/9/sys/fs/nfsclient/nfs_clvfsops.c	Sun Jan  1 16:41:33 2012	(r229172)
@@ -1212,7 +1212,16 @@ mountnfs(struct nfs_args *argp, struct m
 	vfs_getnewfsid(mp);
 	nmp->nm_mountp = mp;
 	mtx_init(&nmp->nm_mtx, "NFSmount lock", NULL, MTX_DEF | MTX_DUPOK);			
+
+	/*
+	 * Since nfs_decode_args() might optionally set them, these need to
+	 * set to defaults before the call, so that the optional settings
+	 * aren't overwritten.
+	 */
 	nmp->nm_negnametimeo = negnametimeo;
+	nmp->nm_timeo = NFS_TIMEO;
+	nmp->nm_retry = NFS_RETRANS;
+	nmp->nm_readahead = NFS_DEFRAHEAD;
 
 	nfs_decode_args(mp, nmp, argp, hst, cred, td);
 
@@ -1231,8 +1240,6 @@ mountnfs(struct nfs_args *argp, struct m
 	else
 		nmp->nm_maxfilesize = OFF_MAX;
 
-	nmp->nm_timeo = NFS_TIMEO;
-	nmp->nm_retry = NFS_RETRANS;
 	if ((argp->flags & (NFSMNT_NFSV3 | NFSMNT_NFSV4)) == 0) {
 		nmp->nm_wsize = NFS_WSIZE;
 		nmp->nm_rsize = NFS_RSIZE;
@@ -1240,7 +1247,6 @@ mountnfs(struct nfs_args *argp, struct m
 	}
 	nmp->nm_wcommitsize = hibufspace / (desiredvnodes / 1000);
 	nmp->nm_numgrps = NFS_MAXGRPS;
-	nmp->nm_readahead = NFS_DEFRAHEAD;
 	nmp->nm_tprintf_delay = nfs_tprintf_delay;
 	if (nmp->nm_tprintf_delay < 0)
 		nmp->nm_tprintf_delay = 0;


More information about the svn-src-stable-9 mailing list