summaryrefslogtreecommitdiffstats
path: root/sys/nfsclient/nfs_vfsops.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1998-05-31 19:20:44 +0000
committerpeter <peter@FreeBSD.org>1998-05-31 19:20:44 +0000
commita378822d22742ffbdef2635478f8e52adb387b80 (patch)
treeff06666108079162665cd2f92a5614f40bfe4a7f /sys/nfsclient/nfs_vfsops.c
parent21746bb862b94bffb63a32df5aa5c582b55ac378 (diff)
downloadFreeBSD-src-a378822d22742ffbdef2635478f8e52adb387b80.zip
FreeBSD-src-a378822d22742ffbdef2635478f8e52adb387b80.tar.gz
Don't blindly accept the server's preferences if they are too small.
Obtained from: NetBSD
Diffstat (limited to 'sys/nfsclient/nfs_vfsops.c')
-rw-r--r--sys/nfsclient/nfs_vfsops.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c
index bbfa4d1..167e6c9 100644
--- a/sys/nfsclient/nfs_vfsops.c
+++ b/sys/nfsclient/nfs_vfsops.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_vfsops.c 8.12 (Berkeley) 5/20/95
- * $Id: nfs_vfsops.c,v 1.65 1998/05/31 17:27:54 peter Exp $
+ * $Id: nfs_vfsops.c,v 1.66 1998/05/31 18:19:43 peter Exp $
*/
#include <sys/param.h>
@@ -344,7 +344,7 @@ nfs_fsinfo(nmp, vp, cred, p)
if (!error) {
nfsm_dissect(fsp, struct nfsv3_fsinfo *, NFSX_V3FSINFO);
pref = fxdr_unsigned(u_long, fsp->fs_wtpref);
- if (pref < nmp->nm_wsize)
+ if (pref < nmp->nm_wsize && pref >= NFS_FABLKSIZE)
nmp->nm_wsize = (pref + NFS_FABLKSIZE - 1) &
~(NFS_FABLKSIZE - 1);
max = fxdr_unsigned(u_long, fsp->fs_wtmax);
@@ -354,7 +354,7 @@ nfs_fsinfo(nmp, vp, cred, p)
nmp->nm_wsize = max;
}
pref = fxdr_unsigned(u_long, fsp->fs_rtpref);
- if (pref < nmp->nm_rsize)
+ if (pref < nmp->nm_rsize && pref >= NFS_FABLKSIZE)
nmp->nm_rsize = (pref + NFS_FABLKSIZE - 1) &
~(NFS_FABLKSIZE - 1);
max = fxdr_unsigned(u_long, fsp->fs_rtmax);
OpenPOWER on IntegriCloud