Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Dec 2015 02:35:12 +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-9@freebsd.org
Subject:   svn commit: r291552 - stable/9/sys/fs/nfsclient
Message-ID:  <201512010235.tB12ZCA5060527@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Tue Dec  1 02:35:12 2015
New Revision: 291552
URL: https://svnweb.freebsd.org/changeset/base/291552

Log:
  MFC: r290970
  mnt_stat.f_iosize (which is used to set bo_bsize) must be set to
  the largest size of buffer cache block or the mapping of the buffer
  is bogus. When a mount with rsize=4096,wsize=4096 was done, f_iosize
  would be set to 4096. This resulted in corrupted directory data, since
  the buffer cache block size for directories is NFS_DIRBLKSIZ (8192).
  This patch fixes the code so that it always sets f_iosize to at least
  NFS_DIRBLKSIZ.

Modified:
  stable/9/sys/fs/nfsclient/nfs_clvfsops.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/fs/   (props changed)

Modified: stable/9/sys/fs/nfsclient/nfs_clvfsops.c
==============================================================================
--- stable/9/sys/fs/nfsclient/nfs_clvfsops.c	Tue Dec  1 02:30:41 2015	(r291551)
+++ stable/9/sys/fs/nfsclient/nfs_clvfsops.c	Tue Dec  1 02:35:12 2015	(r291552)
@@ -207,10 +207,12 @@ newnfs_iosize(struct nfsmount *nmp)
 	 * Calculate the size used for io buffers.  Use the larger
 	 * of the two sizes to minimise nfs requests but make sure
 	 * that it is at least one VM page to avoid wasting buffer
-	 * space.
+	 * space.  It must also be at least NFS_DIRBLKSIZ, since
+	 * that is the buffer size used for directories.
 	 */
 	iosize = imax(nmp->nm_rsize, nmp->nm_wsize);
 	iosize = imax(iosize, PAGE_SIZE);
+	iosize = imax(iosize, NFS_DIRBLKSIZ);
 	nmp->nm_mountp->mnt_stat.f_iosize = iosize;
 	return (iosize);
 }



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