svn commit: r321781 - projects/pnfs-planb-server-stable11/sys/fs/nfs

Rick Macklem rmacklem at FreeBSD.org
Mon Jul 31 12:08:46 UTC 2017


Author: rmacklem
Date: Mon Jul 31 12:08:44 2017
New Revision: 321781
URL: https://svnweb.freebsd.org/changeset/base/321781

Log:
  Manually merge the change that adds vfs.nfs.enable_uidtostring, so I don't
  need to wait for the MFC to stable/11.

Modified:
  projects/pnfs-planb-server-stable11/sys/fs/nfs/nfs_commonsubs.c

Modified: projects/pnfs-planb-server-stable11/sys/fs/nfs/nfs_commonsubs.c
==============================================================================
--- projects/pnfs-planb-server-stable11/sys/fs/nfs/nfs_commonsubs.c	Mon Jul 31 12:03:45 2017	(r321780)
+++ projects/pnfs-planb-server-stable11/sys/fs/nfs/nfs_commonsubs.c	Mon Jul 31 12:08:44 2017	(r321781)
@@ -68,12 +68,17 @@ gid_t nfsrv_defaultgid = GID_NOGROUP;
 int nfsrv_lease = NFSRV_LEASE;
 int ncl_mbuf_mlen = MLEN;
 int nfsd_enable_stringtouid = 0;
+static int nfs_enable_uidtostring = 0;
 NFSNAMEIDMUTEX;
 NFSSOCKMUTEX;
 extern int nfsrv_lughashsize;
 extern struct mtx nfsrv_dslock_mtx;
 extern struct nfsdevicehead nfsrv_devidhead;
 
+SYSCTL_DECL(_vfs_nfs);
+SYSCTL_INT(_vfs_nfs, OID_AUTO, enable_uidtostring, CTLFLAG_RW,
+    &nfs_enable_uidtostring, 0, "Make nfs always send numeric owner_names");
+
 /*
  * This array of structures indicates, for V4:
  * retfh - which of 3 types of calling args are used
@@ -2648,7 +2653,7 @@ nfsv4_uidtostr(uid_t uid, u_char **cpp, int *retlenp, 
 
 	cnt = 0;
 tryagain:
-	if (nfsrv_dnsnamelen > 0) {
+	if (nfsrv_dnsnamelen > 0 && !nfs_enable_uidtostring) {
 		/*
 		 * Always map nfsrv_defaultuid to "nobody".
 		 */
@@ -2910,7 +2915,7 @@ nfsv4_gidtostr(gid_t gid, u_char **cpp, int *retlenp, 
 
 	cnt = 0;
 tryagain:
-	if (nfsrv_dnsnamelen > 0) {
+	if (nfsrv_dnsnamelen > 0 && !nfs_enable_uidtostring) {
 		/*
 		 * Always map nfsrv_defaultgid to "nogroup".
 		 */


More information about the svn-src-projects mailing list