freebsd-nq/bin
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
..
cat Fix exit status. `cat no-such-file >/dev/null' exited with status 0. 1995-10-03 12:46:37 +00:00
chflags
chmod
cp Preserve sticky bit for cp -pR'. It was already preserved for cp -R'. 1995-10-03 12:55:01 +00:00
csh Add missing reaction on LC_ALL and LC_COLLATE 1995-10-23 23:08:26 +00:00
date Add setlocale(LC_TIME,... 1995-10-23 20:26:53 +00:00
dd Add setlocale LC_CTYPE 1995-10-23 21:31:48 +00:00
df Partially fixed negative and truncated "Avail" counts in df output. 1996-01-14 18:55:09 +00:00
domainname
echo
ed This commit was generated by cvs2svn to compensate for changes in r13122, 1995-12-30 19:02:48 +00:00
expr Fix my own brokeness for the colon operator, when one of the arguments 1995-11-18 18:05:03 +00:00
hostname
kill
ln
ls Print dev minor #'s > 255 in hex. 1995-12-30 18:15:30 +00:00
mkdir
mv Handle trailing slashes in source filenames correctly. E.g., rewrite 1995-10-07 10:42:48 +00:00
pax Remove unneded ctype.h everywhere 1995-10-23 21:23:27 +00:00
ps oops. I forgot to add the "[-U username]" option to the usage string. 1996-01-12 08:49:43 +00:00
pwd
rcp
rm
rmail
rmdir
sh Restored formatting from the old printf/printf.c. 1995-12-14 23:19:36 +00:00
sleep
stty Fixed descriptions of ignpar and parmrk. 1995-11-11 03:31:13 +00:00
sync
test Fix -h option: 1995-10-28 11:54:42 +00:00
Makefile ed/Makefile is able to 'decide' for itself whether to build secure or 1995-10-01 14:24:01 +00:00
Makefile.inc Wrong library was picked by ed 1995-10-22 20:14:13 +00:00