diff options
author | bde <bde@FreeBSD.org> | 1996-01-14 18:55:09 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1996-01-14 18:55:09 +0000 |
commit | d1eb245b0ad962a7359d05c2bae5afe05ec72e85 (patch) | |
tree | f11ca3d29cbe8bf42a1caf7f3972f80fb2adbe64 /release/scripts | |
parent | 167b5f5854e2142bcbd74d1a418f45a8907b6fcd (diff) | |
download | FreeBSD-src-d1eb245b0ad962a7359d05c2bae5afe05ec72e85.zip FreeBSD-src-d1eb245b0ad962a7359d05c2bae5afe05ec72e85.tar.gz |
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.
Diffstat (limited to 'release/scripts')
0 files changed, 0 insertions, 0 deletions