Date: Sun, 14 Jan 1996 10:55:21 -0800 (PST) From: Bruce Evans <bde> To: cvs-bin, CVS-committers Subject: cvs commit: src/bin/df df.c Message-ID: <199601141855.KAA16279@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
bde 96/01/14 10:55:10 Modified: sys/ufs/ffs ffs_vfsops.c bin/df df.c Log: 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. Revision Changes Path 1.34 +2 -3 src/sys/ufs/ffs/ffs_vfsops.c 1.8 +2 -5 src/bin/df/df.c
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199601141855.KAA16279>