From 1dcb4f9d7da757c44fcf8e13fa8cc815cfaeb98a Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Thu, 10 Jul 2003 22:32:21 +0000 Subject: in statfs, cast disk size to int64_t to prevent overflow on large disks. from Peter Galbavy --- sys/ufs/ffs/ffs_vfsops.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys') 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) { -- cgit v1.2.3