diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2003-07-10 22:32:21 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2003-07-10 22:32:21 +0000 |
commit | 1dcb4f9d7da757c44fcf8e13fa8cc815cfaeb98a (patch) | |
tree | 99d308744905d84ed2d14cbc6c93e23a4bd1ffb7 /sys | |
parent | 1a5b440da81b2a04d903b4de7d1a6d0d87c1e2ee (diff) |
in statfs, cast disk size to int64_t to prevent overflow on large disks.
from Peter Galbavy
Diffstat (limited to 'sys')
-rw-r--r-- | sys/ufs/ffs/ffs_vfsops.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 0666ea98e7e..8797100a7fb 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs_vfsops.c,v 1.56 2003/06/10 17:51:02 millert Exp $ */ +/* $OpenBSD: ffs_vfsops.c,v 1.57 2003/07/10 22:32:20 tedu Exp $ */ /* $NetBSD: ffs_vfsops.c,v 1.19 1996/02/09 22:22:26 christos Exp $ */ /* @@ -993,7 +993,7 @@ ffs_statfs(mp, sbp, p) sbp->f_blocks = fs->fs_dsize; sbp->f_bfree = fs->fs_cstotal.cs_nbfree * fs->fs_frag + fs->fs_cstotal.cs_nffree; - sbp->f_bavail = sbp->f_bfree - fs->fs_dsize * fs->fs_minfree / 100; + sbp->f_bavail = sbp->f_bfree - ((int64_t)fs->fs_dsize * fs->fs_minfree / 100); sbp->f_files = fs->fs_ncg * fs->fs_ipg - ROOTINO; sbp->f_ffree = fs->fs_cstotal.cs_nifree; if (sbp != &mp->mnt_stat) { |