diff options
author | Rick Macklem <rmacklem@FreeBSD.org> | 2017-07-20 23:15:50 +0000 |
---|---|---|
committer | Rick Macklem <rmacklem@FreeBSD.org> | 2017-07-20 23:15:50 +0000 |
commit | a9d104fd89ce2c1c7eea15f92e25d445a0a00327 (patch) | |
tree | 2c82e0da0e00cfc69d5044ab93f349346e9439bd /sys/fs/nfsclient/nfs_clrpcops.c | |
parent | 9d0a88de9be645cc8fa623f531f48b53c48b024f (diff) | |
download | src-a9d104fd89ce2c1c7eea15f92e25d445a0a00327.tar.gz src-a9d104fd89ce2c1c7eea15f92e25d445a0a00327.zip |
r320062 introduced a bug when doing NFSv4.1 mounts against some non-FreeBSD servers.
r320062 used nm_rsize, nm_wsize to set the maximum request/response sizes for
the NFSv4.1 session. If rsize,wsize are not specified as options, the
value of nm_rsize, nm_wsize is 0 at session creation, resulting in
values for request/response that are too small.
This patch fixes the problem. A workaround is to specify rsize=N,wsize=N
mount options explicitly, so they are set before session creation.
This bug only affects NFSv4.1 mounts against some non-FreeBSD servers.
MFC after: 1 week
Notes
Notes:
svn path=/head/; revision=321308
Diffstat (limited to 'sys/fs/nfsclient/nfs_clrpcops.c')
-rw-r--r-- | sys/fs/nfsclient/nfs_clrpcops.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index 23cc47f5c69c..c135f3254f6c 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -4672,8 +4672,14 @@ nfsrpc_createsession(struct nfsmount *nmp, struct nfsclsession *sep, uint32_t crflags, maxval, *tl; struct nfsrv_descript nfsd; struct nfsrv_descript *nd = &nfsd; - int error, irdcnt; - + int error, irdcnt, rsiz, wsiz; + + rsiz = nmp->nm_rsize; + if (rsiz == 0) + rsiz = NFS_MAXBSIZE; + wsiz = nmp->nm_wsize; + if (wsiz == 0) + wsiz = NFS_MAXBSIZE; nfscl_reqstart(nd, NFSPROC_CREATESESSION, nmp, NULL, 0, NULL, NULL); NFSM_BUILD(tl, uint32_t *, 4 * NFSX_UNSIGNED); *tl++ = sep->nfsess_clientid.lval[0]; @@ -4687,8 +4693,8 @@ nfsrpc_createsession(struct nfsmount *nmp, struct nfsclsession *sep, /* Fill in fore channel attributes. */ NFSM_BUILD(tl, uint32_t *, 7 * NFSX_UNSIGNED); *tl++ = 0; /* Header pad size */ - *tl++ = txdr_unsigned(nmp->nm_wsize + NFS_MAXXDR);/* Max request size */ - *tl++ = txdr_unsigned(nmp->nm_rsize + NFS_MAXXDR);/* Max reply size */ + *tl++ = txdr_unsigned(wsiz + NFS_MAXXDR);/* Max request size */ + *tl++ = txdr_unsigned(rsiz + NFS_MAXXDR);/* Max reply size */ *tl++ = txdr_unsigned(4096); /* Max response size cached */ *tl++ = txdr_unsigned(20); /* Max operations */ *tl++ = txdr_unsigned(64); /* Max slots */ |