Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Jul 2017 23:08:13 +0000 (UTC)
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r321355 - projects/pnfs-planb-server-stable11/sys/fs/nfsclient
Message-ID:  <201707212308.v6LN8D89072216@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Fri Jul 21 23:08:13 2017
New Revision: 321355
URL: https://svnweb.freebsd.org/changeset/base/321355

Log:
  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.

Modified:
  projects/pnfs-planb-server-stable11/sys/fs/nfsclient/nfs_clrpcops.c

Modified: projects/pnfs-planb-server-stable11/sys/fs/nfsclient/nfs_clrpcops.c
==============================================================================
--- projects/pnfs-planb-server-stable11/sys/fs/nfsclient/nfs_clrpcops.c	Fri Jul 21 20:55:38 2017	(r321354)
+++ projects/pnfs-planb-server-stable11/sys/fs/nfsclient/nfs_clrpcops.c	Fri Jul 21 23:08:13 2017	(r321355)
@@ -4664,6 +4664,11 @@ nfsrpc_createsession(struct nfsmount *nmp, struct nfsc
 	struct nfsrv_descript *nd = &nfsd;
 	int error, irdcnt;
 
+	/* Make sure nm_rsize, nm_wsize is set. */
+	if (nmp->nm_rsize > NFS_MAXBSIZE || nmp->nm_rsize == 0)
+		nmp->nm_rsize = NFS_MAXBSIZE;
+	if (nmp->nm_wsize > NFS_MAXBSIZE || nmp->nm_wsize == 0)
+		nmp->nm_wsize = 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];



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201707212308.v6LN8D89072216>