diff options
author | mckusick <mckusick@FreeBSD.org> | 1998-09-29 23:15:53 +0000 |
---|---|---|
committer | mckusick <mckusick@FreeBSD.org> | 1998-09-29 23:15:53 +0000 |
commit | a57013de622b5a4defd9b82335867fc722bc859d (patch) | |
tree | 15309a940474cd8ecb2a689a94ebebf59d9f0bd3 /sys/nfs | |
parent | 44e40659a639144e40f811fb2f1462a6fc70f152 (diff) | |
download | FreeBSD-src-a57013de622b5a4defd9b82335867fc722bc859d.zip FreeBSD-src-a57013de622b5a4defd9b82335867fc722bc859d.tar.gz |
Frank sez: 'It fixes a problem with servers that return 0 values
for some of the fsinfo RPC fields. It is strictly speaking not
wrong to do this, as the spec says that "it is expected that a
server will make a best effort at supporting all the attributes",
but pretty unusual. You guessed it, it's NT servers that do it.'
Obtained from: Frank van der Linden <frank@wins.uva.nl>
Diffstat (limited to 'sys/nfs')
-rw-r--r-- | sys/nfs/nfs_vfsops.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/sys/nfs/nfs_vfsops.c b/sys/nfs/nfs_vfsops.c index 9bfc40c..23e30c0 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.75 1998/09/07 05:42:15 bde Exp $ + * $Id: nfs_vfsops.c,v 1.76 1998/09/07 13:17:05 bde Exp $ */ #include <sys/param.h> @@ -352,7 +352,7 @@ nfs_fsinfo(nmp, vp, cred, p) nmp->nm_wsize = (pref + NFS_FABLKSIZE - 1) & ~(NFS_FABLKSIZE - 1); max = fxdr_unsigned(u_int32_t, fsp->fs_wtmax); - if (max < nmp->nm_wsize) { + if (max < nmp->nm_wsize && max > 0) { nmp->nm_wsize = max & ~(NFS_FABLKSIZE - 1); if (nmp->nm_wsize == 0) nmp->nm_wsize = max; @@ -362,16 +362,19 @@ nfs_fsinfo(nmp, vp, cred, p) nmp->nm_rsize = (pref + NFS_FABLKSIZE - 1) & ~(NFS_FABLKSIZE - 1); max = fxdr_unsigned(u_int32_t, fsp->fs_rtmax); - if (max < nmp->nm_rsize) { + if (max < nmp->nm_rsize && max > 0) { nmp->nm_rsize = max & ~(NFS_FABLKSIZE - 1); if (nmp->nm_rsize == 0) nmp->nm_rsize = max; } pref = fxdr_unsigned(u_int32_t, fsp->fs_dtpref); - if (pref < nmp->nm_readdirsize) - nmp->nm_readdirsize = pref; - if (max < nmp->nm_readdirsize) { - nmp->nm_readdirsize = max; + if (pref < nmp->nm_readdirsize && pref >= NFS_DIRBLKSIZ) + nmp->nm_readdirsize = (pref + NFS_DIRBLKSIZ - 1) & + ~(NFS_DIRBLKSIZ - 1); + if (max < nmp->nm_readdirsize && max > 0) { + nmp->nm_readdirsize = max & ~(NFS_DIRBLKSIZ - 1); + if (nmp->nm_readdirsize == 0) + nmp->nm_readdirsize = max; } fxdr_hyper(&fsp->fs_maxfilesize, &maxfsize); if (maxfsize > 0 && maxfsize < nmp->nm_maxfilesize) |