diff options
author | John Baldwin <jhb@FreeBSD.org> | 2011-08-09 15:29:58 +0000 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2011-08-09 15:29:58 +0000 |
commit | bf2e38e673514abcc5002ebb02de732e3de5b222 (patch) | |
tree | ada269514b89af73bbc1130a4a75ee5c8dbb9cf5 /sys/nfsclient/nfs_bio.c | |
parent | 3797b1fc58740774a55266cba87148720f6e7690 (diff) | |
download | src-bf2e38e673514abcc5002ebb02de732e3de5b222.tar.gz src-bf2e38e673514abcc5002ebb02de732e3de5b222.zip |
Merge 220876, 220877, and 221537 from the new NFS client to the old:
Allow the NFS client to use a max file size larger than 1TB for v3 mounts.
It now allows files up to OFF_MAX subject to whatever limit the server
advertises.
Reviewed by: rmacklem
Approved by: re (kib)
MFC after: 1 week
Notes
Notes:
svn path=/head/; revision=224733
Diffstat (limited to 'sys/nfsclient/nfs_bio.c')
-rw-r--r-- | sys/nfsclient/nfs_bio.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/nfsclient/nfs_bio.c b/sys/nfsclient/nfs_bio.c index da8a2ece335a..305c189d73d8 100644 --- a/sys/nfsclient/nfs_bio.c +++ b/sys/nfsclient/nfs_bio.c @@ -445,6 +445,7 @@ nfs_bioread(struct vnode *vp, struct uio *uio, int ioflag, struct ucred *cred) struct thread *td; struct nfsmount *nmp = VFSTONFS(vp->v_mount); daddr_t lbn, rabn; + off_t end; int bcount; int seqcount; int nra, error = 0, n = 0, on = 0; @@ -464,8 +465,9 @@ nfs_bioread(struct vnode *vp, struct uio *uio, int ioflag, struct ucred *cred) } else mtx_unlock(&nmp->nm_mtx); + end = uio->uio_offset + uio->uio_resid; if (vp->v_type != VDIR && - (uio->uio_offset + uio->uio_resid) > nmp->nm_maxfilesize) + (end > nmp->nm_maxfilesize || end < uio->uio_offset)) return (EFBIG); if (nfs_directio_enable && (ioflag & IO_DIRECT) && (vp->v_type == VREG)) @@ -865,6 +867,7 @@ nfs_write(struct vop_write_args *ap) struct vattr vattr; struct nfsmount *nmp = VFSTONFS(vp->v_mount); daddr_t lbn; + off_t end; int bcount; int n, on, error = 0; @@ -932,7 +935,8 @@ flush_and_restart: if (uio->uio_offset < 0) return (EINVAL); - if ((uio->uio_offset + uio->uio_resid) > nmp->nm_maxfilesize) + end = uio->uio_offset + uio->uio_resid; + if (end > nmp->nm_maxfilesize || end < uio->uio_offset) return (EFBIG); if (uio->uio_resid == 0) return (0); |