freebsd-skq/sys
Ian Dowse 23bd68a426 Fix a bug in ufsdirhash_adjfree() that caused it to incorrectly
update the free-space statistics in some cases. The problem affected
directory blocks when the free space dropped below the size of the
maximum allowed entry size. When this happened, the free-space
summary information could claim that there are no further blocks
that can fit a maximum-size entry, even if there are.

The effect of this bug is that the directory may be enlarged even
though there is space within the directory for the new entry. This
wastes disk space and has a negative impact on performance.

Fix it by correctly computing the dh_firstfree array index, adding
a helper macro for clarity. Put an extra sanity check into
ufsdirhash_checkblock() to detect the situation in future.

Found by:	dwmalone
Reviewed by:	dwmalone
MFC after:	1 week
2002-03-11 19:13:22 +00:00
..
alpha o Don't require long long support in bswap64() functions. 2002-03-09 21:02:16 +00:00
amd64 Export a (machine dependent) kernel variable bootdev as 2002-03-10 20:08:44 +00:00
arm We need machine/{signal,ucontext}.h to build a cross GCC compiler. 2001-12-09 19:39:49 +00:00
boot CG superfluous prototype. 2002-03-10 22:33:04 +00:00
cam Mark some arguments __unused. 2002-03-11 08:04:59 +00:00
coda Simple p_ucred -> td_ucred changes to start using the per-thread ucred 2002-02-27 18:32:23 +00:00
compat Simple p_ucred -> td_ucred changes to start using the per-thread ucred 2002-02-27 18:32:23 +00:00
conf Add commented out GEOM line to NOTES 2002-03-11 08:27:23 +00:00
contrib Change two occurrences of HTONS() to use htons(). 2002-02-28 09:56:31 +00:00
crypto - Speedup 3DES by using assembly code for i386. 2002-03-05 09:19:02 +00:00
ddb Allow '.' in identifiers - some ia64 register names contain '.'. 2002-03-10 17:08:24 +00:00
dev On FreeBSD make usb_proc_t the same as d_thred_t always. 2002-03-11 16:38:53 +00:00
fs If in strategy we find that we have no devsw on the device anymore we 2002-03-05 13:25:57 +00:00
geom Simple p_ucred -> td_ucred changes to start using the per-thread ucred 2002-02-27 18:32:23 +00:00
gnu Remove use of the bogus ioctl DIOCGPART. 2002-03-11 10:11:00 +00:00
i4b remove BSD/OS specific ppp-interface file since the FreeBSD-BSD/OS merger 2002-03-09 13:18:24 +00:00
i386 Add commented out GEOM line to NOTES 2002-03-11 08:27:23 +00:00
ia64 Add an implementation of cpu_throw() and make restorectx() simply branch 2002-03-10 20:20:31 +00:00
isa Add SONY VAIO psm controller ISA-PnP ID. 2002-03-10 12:22:17 +00:00
isofs/cd9660 Simple p_ucred -> td_ucred changes to start using the per-thread ucred 2002-02-27 18:32:23 +00:00
kern Make the disk_clone() routine more robust for abuse. 2002-03-11 08:08:02 +00:00
libkern DBA update: used the wrong of several NAI DBAs. 2002-03-07 17:52:03 +00:00
modules Add generalized power profile code. 2002-03-04 18:46:13 +00:00
net Simplify the interface cloning framework by handling unit 2002-03-11 09:26:07 +00:00
netatalk Make `options NETATALK' compile after the -fno-common changes. 2002-01-16 11:26:50 +00:00
netatm Unbreak fore adapters from POV of warnings. 2002-02-27 21:12:44 +00:00
netgraph Official timeout routines for netgraph nodes that know how to 2002-03-05 20:26:20 +00:00
netinet o Add INET_ADDRSTRLEN and INET6_ADDRSTRLEN defines to <arpa/inet.h> 2002-03-10 06:42:27 +00:00
netinet6 o Add INET_ADDRSTRLEN and INET6_ADDRSTRLEN defines to <arpa/inet.h> 2002-03-10 06:42:27 +00:00
netipx Pre-KSE/M3 commit. 2002-02-07 20:58:47 +00:00
netkey missing splx 2002-03-01 13:13:17 +00:00
netnatm Fix warnings 2002-02-28 03:02:20 +00:00
netncp Update to C99, s/__FUNCTION__/__func__/, 2001-12-10 08:09:49 +00:00
netns Initialise the intrq_present fields at runtime, not link time. This allows 2002-01-08 10:34:03 +00:00
netsmb Simple p_ucred -> td_ucred changes to start using the per-thread ucred 2002-02-27 18:32:23 +00:00
nfs When the old nfsm_adv() macro was moved to nfsm_adv_xx(), a '>=' 2001-12-31 06:56:31 +00:00
nfsclient vhold() our vnode while checking the remote side. 2002-03-08 13:43:43 +00:00
nfsserver Simple p_ucred -> td_ucred changes to start using the per-thread ucred 2002-02-27 18:32:23 +00:00
pc98 Free allocated buffer at siodetach(). 2002-03-10 07:22:42 +00:00
pccard Get the generic name right 2002-03-03 01:04:39 +00:00
pci Fix warning; amdsmb_abort() is not used. 2002-02-26 01:04:58 +00:00
posix4 In a threaded world, differnt priorirites become properties of 2002-02-11 20:37:54 +00:00
powerpc Correct a typo. (* that should've been &) 2002-03-11 07:09:42 +00:00
rpc
security/lomac Simple p_ucred -> td_ucred changes to start using the per-thread ucred 2002-02-27 18:32:23 +00:00
sparc64 Fix the type of some constants, and make some macros safer by casting 2002-03-11 03:04:28 +00:00
svr4
sys Augment struct bio for GEOM. 2002-03-11 08:20:22 +00:00
tools Return vnode_if back to its AWK roots. 2002-03-01 01:20:23 +00:00
ufs Fix a bug in ufsdirhash_adjfree() that caused it to incorrectly 2002-03-11 19:13:22 +00:00
vm - Remove a number of extra newlines that do not belong here according to 2002-03-10 21:52:48 +00:00
Makefile