Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Dec 2016 07:48:05 +0000 (UTC)
From:      Colin Percival <cperciva@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r310241 - stable/11/sys/fs/nfs
Message-ID:  <201612190748.uBJ7m5kD037830@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cperciva
Date: Mon Dec 19 07:48:04 2016
New Revision: 310241
URL: https://svnweb.freebsd.org/changeset/base/310241

Log:
  MFC r308708: Reduce verbosity of warnings about truncating NFS fileids to
  32-bit inode numbers.

Modified:
  stable/11/sys/fs/nfs/nfs_commonsubs.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/fs/nfs/nfs_commonsubs.c
==============================================================================
--- stable/11/sys/fs/nfs/nfs_commonsubs.c	Mon Dec 19 07:46:20 2016	(r310240)
+++ stable/11/sys/fs/nfs/nfs_commonsubs.c	Mon Dec 19 07:48:04 2016	(r310241)
@@ -827,6 +827,12 @@ nfsv4_loadattr(struct nfsrv_descript *nd
 	struct dqblk dqb;
 	uid_t savuid;
 #endif
+	static struct timeval last64fileid;
+	static size_t count64fileid;
+	static struct timeval last64mountfileid;
+	static size_t count64mountfileid;
+	static struct timeval warninterval = { 60, 0 };
+
 	if (compare) {
 		retnotsup = 0;
 		error = nfsrv_getattrbits(nd, &attrbits, NULL, &retnotsup);
@@ -1202,8 +1208,14 @@ nfsv4_loadattr(struct nfsrv_descript *nd
 					*retcmpp = NFSERR_NOTSAME;
 				}
 			} else if (nap != NULL) {
-				if (*tl++)
-					printf("NFSv4 fileid > 32bits\n");
+				if (*tl++) {
+					count64fileid++;
+					if (ratecheck(&last64fileid, &warninterval)) {
+						printf("NFSv4 fileid > 32bits (%zu occurrences)\n",
+						    count64fileid);
+						count64fileid = 0;
+					}
+				}
 				nap->na_fileid = thyp;
 			}
 			attrsum += NFSX_HYPER;
@@ -1740,8 +1752,14 @@ nfsv4_loadattr(struct nfsrv_descript *nd
 				}
 			    }
 			} else if (nap != NULL) {
-			    if (*tl++)
-				printf("NFSv4 mounted on fileid > 32bits\n");
+			    if (*tl++) {
+				count64mountfileid++;
+				if (ratecheck(&last64mountfileid, &warninterval)) {
+					printf("NFSv4 mounted on fileid > 32bits (%zu occurrences)\n",
+					    count64mountfileid);
+					count64mountfileid = 0;
+				}
+			    }
 			    nap->na_mntonfileno = thyp;
 			}
 			attrsum += NFSX_HYPER;



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