summaryrefslogtreecommitdiffstats
path: root/sys/nfsclient/nfs_vfsops.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1998-05-30 16:33:58 +0000
committerpeter <peter@FreeBSD.org>1998-05-30 16:33:58 +0000
commitaa33f209931229b1ec794891bd3a69a8eff05835 (patch)
tree5c600b7c603c70dd7c1f21b9426387f4c7902f04 /sys/nfsclient/nfs_vfsops.c
parent0d948cca0487b241fec6cc5211d55dc5ffabb72c (diff)
downloadFreeBSD-src-aa33f209931229b1ec794891bd3a69a8eff05835.zip
FreeBSD-src-aa33f209931229b1ec794891bd3a69a8eff05835.tar.gz
When using NFSv3, use the remote server's idea of the maximum file size
rather than assuming 2^64. It may not like files that big. :-) On the nfs server, calculate and report the max file size as the point that the block numbers in the cache would turn negative. (ie: 1099511627775 bytes (1TB)). One of the things I'm worried about however, is that directory offsets are really cookies on a NFSv3 server and can be rather large, especially when/if the server generates the opaque directory cookies by using a local filesystem offset in what comes out as the upper 32 bits of the 64 bit cookie. (a server is free to do this, it could save byte swapping depending on the native 64 bit byte order) Obtained from: NetBSD
Diffstat (limited to 'sys/nfsclient/nfs_vfsops.c')
-rw-r--r--sys/nfsclient/nfs_vfsops.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c
index 729ccba..554b0ef 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.62 1998/05/20 08:05:45 peter Exp $
+ * $Id: nfs_vfsops.c,v 1.63 1998/05/24 14:41:56 peter Exp $
*/
#include <sys/param.h>
@@ -333,6 +333,7 @@ nfs_fsinfo(nmp, vp, cred, p)
caddr_t bpos, dpos, cp2;
int error = 0, retattr;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
+ u_int64_t maxfsize;
nfsstats.rpccnt[NFSPROC_FSINFO]++;
nfsm_reqhead(vp, NFSPROC_FSINFO, NFSX_FH(1));
@@ -367,6 +368,11 @@ nfs_fsinfo(nmp, vp, cred, p)
if (max < nmp->nm_readdirsize) {
nmp->nm_readdirsize = max;
}
+ /* XXX */
+ nmp->nm_maxfilesize = (u_int64_t)0x80000000 * DEV_BSIZE - 1;
+ fxdr_hyper(&fsp->fs_maxfilesize, &maxfsize);
+ if (maxfsize > 0 && maxfsize < nmp->nm_maxfilesize)
+ nmp->nm_maxfilesize = maxfsize;
nmp->nm_state |= NFSSTA_GOTFSINFO;
}
nfsm_reqdone;
@@ -690,6 +696,13 @@ mountnfs(argp, mp, nam, pth, hst, vpp)
* unsuspecting binaries).
*/
mp->mnt_maxsymlinklen = 1;
+ if ((argp->flags & NFSMNT_NFSV3) == 0)
+ /*
+ * V2 can only handle 32 bit filesizes. For v3, nfs_fsinfo
+ * will fill this in.
+ */
+ nmp->nm_maxfilesize = 0xffffffffLL;
+
nmp->nm_timeo = NFS_TIMEO;
nmp->nm_retry = NFS_RETRANS;
nmp->nm_wsize = NFS_WSIZE;
OpenPOWER on IntegriCloud