summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrmacklem <rmacklem@FreeBSD.org>2014-11-05 23:12:39 +0000
committerrmacklem <rmacklem@FreeBSD.org>2014-11-05 23:12:39 +0000
commit1dc5bfe0b1157cb80adb6eedb33ef3ac0ab1d4ce (patch)
tree054bb5932f63d392b203ba69ad72dd6cec2436f2
parent7cb84aa335f24a33ed83e2125c0b793f94445205 (diff)
downloadFreeBSD-src-1dc5bfe0b1157cb80adb6eedb33ef3ac0ab1d4ce.zip
FreeBSD-src-1dc5bfe0b1157cb80adb6eedb33ef3ac0ab1d4ce.tar.gz
MFC: r273486
Clip the settings for the NFS rsize, wsize mount options to a power of 2. For non-power of 2 settings, intermittent page faults have been reported. Although the bug that causes these page faults/crashes has not been identified, it does not appear to occur when rsize, wsize is a power of 2.
-rw-r--r--sys/fs/nfsclient/nfs_clvfsops.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/sys/fs/nfsclient/nfs_clvfsops.c b/sys/fs/nfsclient/nfs_clvfsops.c
index 6b09356..4cbbb24 100644
--- a/sys/fs/nfsclient/nfs_clvfsops.c
+++ b/sys/fs/nfsclient/nfs_clvfsops.c
@@ -621,17 +621,27 @@ nfs_decode_args(struct mount *mp, struct nfsmount *nmp, struct nfs_args *argp,
if ((argp->flags & NFSMNT_WSIZE) && argp->wsize > 0) {
nmp->nm_wsize = argp->wsize;
- /* Round down to multiple of blocksize */
- nmp->nm_wsize &= ~(NFS_FABLKSIZE - 1);
- if (nmp->nm_wsize <= 0)
+ /*
+ * Clip at the power of 2 below the size. There is an
+ * issue (not isolated) that causes intermittent page
+ * faults if this is not done.
+ */
+ if (nmp->nm_wsize > NFS_FABLKSIZE)
+ nmp->nm_wsize = 1 << (fls(nmp->nm_wsize) - 1);
+ else
nmp->nm_wsize = NFS_FABLKSIZE;
}
if ((argp->flags & NFSMNT_RSIZE) && argp->rsize > 0) {
nmp->nm_rsize = argp->rsize;
- /* Round down to multiple of blocksize */
- nmp->nm_rsize &= ~(NFS_FABLKSIZE - 1);
- if (nmp->nm_rsize <= 0)
+ /*
+ * Clip at the power of 2 below the size. There is an
+ * issue (not isolated) that causes intermittent page
+ * faults if this is not done.
+ */
+ if (nmp->nm_rsize > NFS_FABLKSIZE)
+ nmp->nm_rsize = 1 << (fls(nmp->nm_rsize) - 1);
+ else
nmp->nm_rsize = NFS_FABLKSIZE;
}
OpenPOWER on IntegriCloud