svn commit: r299226 - head/sys/fs/nfsserver

Rick Macklem rmacklem at FreeBSD.org
Sat May 7 22:45:10 UTC 2016


Author: rmacklem
Date: Sat May  7 22:45:08 2016
New Revision: 299226
URL: https://svnweb.freebsd.org/changeset/base/299226

Log:
  Don't increment srvrpccnt[] for the NFSv4.1 operations.
  
  When support for NFSv4.1 was added to the NFS server, it broke
  the server rpc count stats, since newnfsstats.srvrpccnt[] doesn't
  have entries for the new NFSv4.1 operations.
  Without this patch, the code was incrementing bogus entries in
  newnfsstats for the new NFSv4.1 operations.
  This patch is an interim fix. The nfsstats structure needs to be
  updated and that will come in a future commit.
  
  Reported by:	cem
  MFC after:	2 weeks

Modified:
  head/sys/fs/nfsserver/nfs_nfsdsocket.c

Modified: head/sys/fs/nfsserver/nfs_nfsdsocket.c
==============================================================================
--- head/sys/fs/nfsserver/nfs_nfsdsocket.c	Sat May  7 21:34:04 2016	(r299225)
+++ head/sys/fs/nfsserver/nfs_nfsdsocket.c	Sat May  7 22:45:08 2016	(r299226)
@@ -771,7 +771,12 @@ nfsrvd_compound(struct nfsrv_descript *n
 		}
 		if (nfsv4_opflag[op].savereply)
 			nd->nd_flag |= ND_SAVEREPLY;
-		NFSINCRGLOBAL(newnfsstats.srvrpccnt[nd->nd_procnum]);
+		/*
+		 * For now, newnfsstats.srvrpccnt[] doesn't have entries
+		 * for the NFSv4.1 operations.
+		 */
+		if (nd->nd_procnum < NFSV4OP_NOPS)
+			NFSINCRGLOBAL(newnfsstats.srvrpccnt[nd->nd_procnum]);
 		switch (op) {
 		case NFSV4OP_PUTFH:
 			error = nfsrv_mtofh(nd, &fh);


More information about the svn-src-all mailing list