diff options
author | rmacklem <rmacklem@FreeBSD.org> | 2011-11-13 23:09:26 +0000 |
---|---|---|
committer | rmacklem <rmacklem@FreeBSD.org> | 2011-11-13 23:09:26 +0000 |
commit | 7ec76cbdce92f37cf3b1dc3c2744ac8e00f87667 (patch) | |
tree | f409447bec7c1a0b37bfd251e52957d16371bb79 | |
parent | c1a98a91d0f91cc1c8816692fe1b1779312fde05 (diff) | |
download | FreeBSD-src-7ec76cbdce92f37cf3b1dc3c2744ac8e00f87667.zip FreeBSD-src-7ec76cbdce92f37cf3b1dc3c2744ac8e00f87667.tar.gz |
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.
MFC after: 2 weeks
-rw-r--r-- | sys/fs/nfsclient/nfs_clvfsops.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/fs/nfsclient/nfs_clvfsops.c b/sys/fs/nfsclient/nfs_clvfsops.c index 3339428..6782c5d 100644 --- a/sys/fs/nfsclient/nfs_clvfsops.c +++ b/sys/fs/nfsclient/nfs_clvfsops.c @@ -1212,7 +1212,16 @@ mountnfs(struct nfs_args *argp, struct mount *mp, struct sockaddr *nam, 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 mount *mp, struct sockaddr *nam, 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 mount *mp, struct sockaddr *nam, } 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; |