Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Jan 2017 19:18:56 +0000 (UTC)
From:      Josh Paetzel <jpaetzel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r311122 - head/sys/fs/nfsserver
Message-ID:  <201701021918.v02JIuxT050513@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jpaetzel
Date: Mon Jan  2 19:18:56 2017
New Revision: 311122
URL: https://svnweb.freebsd.org/changeset/base/311122

Log:
  Workaround NFS bug with readdirplus when there are greater than 1 billion files in a filesystem.
  
  Reviewed by	kib
  MFC after:	2 weeks
  Sponsored by:	iXsystems
  Differential Revision:	D9009

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

Modified: head/sys/fs/nfsserver/nfs_nfsdport.c
==============================================================================
--- head/sys/fs/nfsserver/nfs_nfsdport.c	Mon Jan  2 19:18:33 2017	(r311121)
+++ head/sys/fs/nfsserver/nfs_nfsdport.c	Mon Jan  2 19:18:56 2017	(r311122)
@@ -2018,25 +2018,17 @@ again:
 	}
 
 	/*
-	 * Check to see if entries in this directory can be safely acquired
-	 * via VFS_VGET() or if a switch to VOP_LOOKUP() is required.
-	 * ZFS snapshot directories need VOP_LOOKUP(), so that any
-	 * automount of the snapshot directory that is required will
-	 * be done.
-	 * This needs to be done here for NFSv4, since NFSv4 never does
-	 * a VFS_VGET() for "." or "..".
+	 * For now ZFS requires VOP_LOOKUP as a workaround.  Until ino_t is changed
+	 * to 64 bit type a ZFS filesystem with over 1 billion files in it
+	 * will suffer from 64bit -> 32bit truncation.
 	 */
-	if (is_zfs == 1) {
-		r = VFS_VGET(mp, at.na_fileid, LK_SHARED, &nvp);
-		if (r == EOPNOTSUPP) {
-			usevget = 0;
-			cn.cn_nameiop = LOOKUP;
-			cn.cn_lkflags = LK_SHARED | LK_RETRY;
-			cn.cn_cred = nd->nd_cred;
-			cn.cn_thread = p;
-		} else if (r == 0)
-			vput(nvp);
-	}
+	if (is_zfs == 1)
+		usevget = 0;
+
+	cn.cn_nameiop = LOOKUP;
+	cn.cn_lkflags = LK_SHARED | LK_RETRY;
+	cn.cn_cred = nd->nd_cred;
+	cn.cn_thread = p;
 
 	/*
 	 * Save this position, in case there is an error before one entry
@@ -2105,16 +2097,7 @@ again:
 					else
 						r = EOPNOTSUPP;
 					if (r == EOPNOTSUPP) {
-						if (usevget) {
-							usevget = 0;
-							cn.cn_nameiop = LOOKUP;
-							cn.cn_lkflags =
-							    LK_SHARED |
-							    LK_RETRY;
-							cn.cn_cred =
-							    nd->nd_cred;
-							cn.cn_thread = p;
-						}
+						usevget = 0;
 						cn.cn_nameptr = dp->d_name;
 						cn.cn_namelen = nlen;
 						cn.cn_flags = ISLASTCN |



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