FreeBSD src
Go to file
Bruce Evans 51ea8b57b8 Partially fixed negative and truncated "Avail" counts in df output.
This fixes PR943.

ffs/ffs_vfsops.c:
ffs_statfs() multiplied by (100 - minfree) as part of calculating the
minfree percentage (complemented in 100%), so with the standard minfree
of 8, it was broken for file systems of size >= 1TB/92 = 11GB.  Use the
standard freespace() macro instead.  This also fixes a rounding bug (the
"Avail" count was sometimes 1 too small).

ffs/* (not fixed):
The freespace() macro multiplies by minfree, so with the standard
minfree of 8, it is broken for file systems of size >= 1TB/8 = 128GB.
This bug is more serious since it affects block allocation.

ffs/ffs_alloc.c (not fixed):
Ordinary users are sometimes allowed to allocate 1 (partial) block
too many so that the "Avail" count goes negative.  E.g., if there is
1 fragment available and the file is fairly large, one more full
block is allocated.

df/df.c:
ufs_df() used/uses essentially the same code as ffs_statfs(), so it
had/has the same bugs.

ufs_df() gratuitously replaced "Avail" counts of < 0 by 0, so it
gave different results for non-mounted file systems in this case.
1996-01-14 18:55:09 +00:00
bin Partially fixed negative and truncated "Avail" counts in df output. 1996-01-14 18:55:09 +00:00
eBones recording cvs-1.6 file death 1995-12-30 19:02:48 +00:00
etc Add empty /var/log/slip.log creation to distribution: target where 1996-01-10 21:22:28 +00:00
games recording cvs-1.6 file death 1995-12-30 19:02:48 +00:00
gnu This release is a moderate restructuring of the dynamic linker. 1996-01-13 00:15:25 +00:00
include Update resolver include files to bind-4.9.3-rel level 1996-01-07 05:01:52 +00:00
lib Return pointer to new hash node when search inserts it (e.g. there 1996-01-13 14:25:04 +00:00
libexec This release is a moderate restructuring of the dynamic linker. 1996-01-13 00:15:25 +00:00
lkm No longer generate empty opt_sysvipc.h, and no longer issue -DSYSVSHM etc 1996-01-08 05:36:17 +00:00
release Don't try to swap to a disk that isn't selected. 1996-01-14 11:45:05 +00:00
sbin Yet another "fix" for some of the mistakes in the recent versions.. 1996-01-08 10:23:25 +00:00
secure This commit was generated by cvs2svn to compensate for changes in r13122, 1995-12-30 19:02:48 +00:00
share Add "Wes Santee <wsantee@wsantee.oz.net>" for the tkHTML/wwwish distfile 1996-01-13 07:53:08 +00:00
sys Partially fixed negative and truncated "Avail" counts in df output. 1996-01-14 18:55:09 +00:00
tools Don't look in libkern, it went away. 1995-12-29 01:51:23 +00:00
usr.bin Forgot to update the man page for the `retension' command. 1996-01-13 09:46:26 +00:00
usr.sbin Don't try to swap to a disk that isn't selected. 1996-01-14 11:45:05 +00:00
COPYRIGHT This is the official 4.4 Lite copyright. 1994-09-11 07:53:28 +00:00
Makefile Add libutil/beforeinstall to the includes target 1996-01-01 08:33:17 +00:00