diff options
author | ps <ps@FreeBSD.org> | 2004-12-01 06:42:21 +0000 |
---|---|---|
committer | ps <ps@FreeBSD.org> | 2004-12-01 06:42:21 +0000 |
commit | 69d7e65011bc973bc85975779d33f32217b72d74 (patch) | |
tree | 9903a9ef0bbdd06b6bc4f5ab5b4ed344fbed9824 /sys/nfsclient/nfs_vfsops.c | |
parent | c106bd9120d0e0d75dc9a28f87686d6b6d18ae8c (diff) | |
download | FreeBSD-src-69d7e65011bc973bc85975779d33f32217b72d74.zip FreeBSD-src-69d7e65011bc973bc85975779d33f32217b72d74.tar.gz |
Fix for a (blocks) underrun bug where negative values were being
returned back to df from a statfs call. Causing df to print negative
values.
Submitted by: Mohan Srinivasan mohans at yahoo-inc dot com
Reviewed by: rwatson
Diffstat (limited to 'sys/nfsclient/nfs_vfsops.c')
-rw-r--r-- | sys/nfsclient/nfs_vfsops.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c index bde4c23..e5c23d3 100644 --- a/sys/nfsclient/nfs_vfsops.c +++ b/sys/nfsclient/nfs_vfsops.c @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include <sys/sockio.h> #include <sys/sysctl.h> #include <sys/vnode.h> +#include <sys/signalvar.h> #include <vm/vm.h> #include <vm/vm_extern.h> @@ -270,17 +271,17 @@ nfs_statfs(struct mount *mp, struct statfs *sbp, struct thread *td) for (bsize = NFS_FABLKSIZE; ; bsize *= 2) { sbp->f_bsize = bsize; tquad = fxdr_hyper(&sfp->sf_tbytes); - if (((long)(tquad / bsize) > LONG_MAX) || + if (((unsigned long)(tquad / bsize) > LONG_MAX) || ((long)(tquad / bsize) < LONG_MIN)) continue; sbp->f_blocks = tquad / bsize; tquad = fxdr_hyper(&sfp->sf_fbytes); - if (((long)(tquad / bsize) > LONG_MAX) || + if (((unsigned long)(tquad / bsize) > LONG_MAX) || ((long)(tquad / bsize) < LONG_MIN)) continue; sbp->f_bfree = tquad / bsize; tquad = fxdr_hyper(&sfp->sf_abytes); - if (((long)(tquad / bsize) > LONG_MAX) || + if (((unsigned long)(tquad / bsize) > LONG_MAX) || ((long)(tquad / bsize) < LONG_MIN)) continue; sbp->f_bavail = tquad / bsize; |