Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 Jun 2015 20:54:42 +0000 (UTC)
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r284101 - stable/10/sys/fs/nfsclient
Message-ID:  <201506062054.t56Ksggh067937@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Sat Jun  6 20:54:41 2015
New Revision: 284101
URL: https://svnweb.freebsd.org/changeset/base/284101

Log:
  MFC: r283330
  The NFS client generated directory block(s) with d_fileno == 0
  so that it would not return less data than requested.
  Since returning less directory data than requested is not a problem
  for FreeBSD and even UFS no longer returns directory structures
  with d_fileno == 0, this patch stops the client from doing this.
  Although entries with d_fileno == 0 should not be a problem,
  the man pages no longer document that these entries should be
  ignored, so there was a concern that these entries might be an
  issue in the future.

Modified:
  stable/10/sys/fs/nfsclient/nfs_clrpcops.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/fs/nfsclient/nfs_clrpcops.c
==============================================================================
--- stable/10/sys/fs/nfsclient/nfs_clrpcops.c	Sat Jun  6 20:37:40 2015	(r284100)
+++ stable/10/sys/fs/nfsclient/nfs_clrpcops.c	Sat Jun  6 20:54:41 2015	(r284101)
@@ -3070,25 +3070,6 @@ nfsrpc_readdir(vnode_t vp, struct uio *u
 			*eofp = eof;
 	}
 
-	/*
-	 * Add extra empty records to any remaining DIRBLKSIZ chunks.
-	 */
-	while (uio_uio_resid(uiop) > 0 && ((size_t)(uio_uio_resid(uiop))) != tresid) {
-		dp = (struct dirent *) CAST_DOWN(caddr_t, uio_iov_base(uiop));
-		dp->d_type = DT_UNKNOWN;
-		dp->d_fileno = 0;
-		dp->d_namlen = 0;
-		dp->d_name[0] = '\0';
-		tl = (u_int32_t *)&dp->d_name[4];
-		*tl++ = cookie.lval[0];
-		*tl = cookie.lval[1];
-		dp->d_reclen = DIRBLKSIZ;
-		uio_iov_base_add(uiop, DIRBLKSIZ);
-		uio_iov_len_add(uiop, -(DIRBLKSIZ));
-		uio_uio_resid_add(uiop, -(DIRBLKSIZ));
-		uiop->uio_offset += DIRBLKSIZ;
-	}
-
 nfsmout:
 	if (nd->nd_mrep != NULL)
 		mbuf_freem(nd->nd_mrep);
@@ -3563,25 +3544,6 @@ nfsrpc_readdirplus(vnode_t vp, struct ui
 			*eofp = eof;
 	}
 
-	/*
-	 * Add extra empty records to any remaining DIRBLKSIZ chunks.
-	 */
-	while (uio_uio_resid(uiop) > 0 && uio_uio_resid(uiop) != tresid) {
-		dp = (struct dirent *)uio_iov_base(uiop);
-		dp->d_type = DT_UNKNOWN;
-		dp->d_fileno = 0;
-		dp->d_namlen = 0;
-		dp->d_name[0] = '\0';
-		tl = (u_int32_t *)&dp->d_name[4];
-		*tl++ = cookie.lval[0];
-		*tl = cookie.lval[1];
-		dp->d_reclen = DIRBLKSIZ;
-		uio_iov_base_add(uiop, DIRBLKSIZ);
-		uio_iov_len_add(uiop, -(DIRBLKSIZ));
-		uio_uio_resid_add(uiop, -(DIRBLKSIZ));
-		uiop->uio_offset += DIRBLKSIZ;
-	}
-
 nfsmout:
 	if (nd->nd_mrep != NULL)
 		mbuf_freem(nd->nd_mrep);



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