From ad559c68bcc036e5cc02cb126e3ad7e152e553d6 Mon Sep 17 00:00:00 2001 From: Peter Wemm Date: Mon, 7 Jun 1999 00:57:01 +0000 Subject: MFC: don't integer overflow for va_bytes on >2G files (when converting a blocks-used count to a bytes-used count) --- sys/nfs/nfs_subs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/nfs/nfs_subs.c b/sys/nfs/nfs_subs.c index 210d3ece69af..1e5871a70f62 100644 --- a/sys/nfs/nfs_subs.c +++ b/sys/nfs/nfs_subs.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_subs.c 8.3 (Berkeley) 1/4/94 - * $Id: nfs_subs.c,v 1.15.4.3 1995/07/20 10:34:12 davidg Exp $ + * $Id: nfs_subs.c,v 1.15.4.4 1996/03/21 20:30:02 phk Exp $ */ /* @@ -804,7 +804,8 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper) } else { vap->va_size = fxdr_unsigned(u_long, fp->fa_nfssize); vap->va_blocksize = fxdr_unsigned(long, fp->fa_nfsblocksize); - vap->va_bytes = fxdr_unsigned(long, fp->fa_nfsblocks) * NFS_FABLKSIZE; + vap->va_bytes = (u_quad_t)fxdr_unsigned(long, fp->fa_nfsblocks) + * NFS_FABLKSIZE; vap->va_fileid = fxdr_unsigned(long, fp->fa_nfsfileid); fxdr_nfstime(&fp->fa_nfsatime, &vap->va_atime); vap->va_flags = 0; -- cgit v1.3