diff options
author | peter <peter@FreeBSD.org> | 1998-05-31 19:20:44 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1998-05-31 19:20:44 +0000 |
commit | a378822d22742ffbdef2635478f8e52adb387b80 (patch) | |
tree | ff06666108079162665cd2f92a5614f40bfe4a7f /sys | |
parent | 21746bb862b94bffb63a32df5aa5c582b55ac378 (diff) | |
download | FreeBSD-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')
-rw-r--r-- | sys/nfs/nfs_vfsops.c | 6 | ||||
-rw-r--r-- | sys/nfsclient/nfs_vfsops.c | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/sys/nfs/nfs_vfsops.c b/sys/nfs/nfs_vfsops.c index bbfa4d1..167e6c9 100644 --- a/sys/nfs/nfs_vfsops.c +++ b/sys/nfs/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); 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); |