freebsd-skq/sys
mckusick d6b473bae1 This patch corrects two problems with the rate limiting code
that was introduced in revision 1.80. The problem manifested
itself with a `locking against myself' panic and could also
result in soft updates inconsistences associated with inodedeps.
The two problems are:

1) One of the background operations could manipulate the bitmap
while holding it locked with intent to create. This held lock
results in a `locking against myself' panic, when the background
processing that we have been coopted to do tries to lock the bitmap
which we are already holding locked. To understand how to fix this
problem, first, observe that we can do the background cleanups in
inodedep_lookup only when allocating inodedeps (DEPALLOC is set in
the call to inodedep_lookup). Second observe that calls to
inodedep_lookup with DEPALLOC set can only happen from the following
calls into the softdep code:

        softdep_setup_inomapdep
        softdep_setup_allocdirect
        softdep_setup_remove
        softdep_setup_freeblocks
        softdep_setup_directory_change
        softdep_setup_directory_add
        softdep_change_linkcnt

Only the first two of these can come from ffs_alloc.c while holding
a bitmap locked. Thus, inodedep_lookup must not go off to do
request_cleanups when being called from these functions. This change
adds a flag, NODELAY, that can be passed to inodedep_lookup to let
it know that it should not do background processing in those cases.

2) The return value from request_cleanup when helping out with the
cleanup was 0 instead of 1. This meant that despite the fact that
we may have slept while doing the cleanups, the code did not recheck
for the appearance of an inodedep (e.g., goto top in inodedep_lookup).
This lead to the softdep inconsistency in which we ended up with
two inodedep's for the same inode.

Reviewed by:	Peter Wemm <peter@yahoo-inc.com>,
		Matt Dillon <dillon@earth.backplane.com>
2001-02-20 11:14:38 +00:00
..
alpha - Add a new ithread_schedule() function to do the bulk of the work of 2001-02-20 10:25:29 +00:00
amd64 - Add a new ithread_schedule() function to do the bulk of the work of 2001-02-20 10:25:29 +00:00
arm/include Correct disordering which is corresponding to bde's fix to 2001-02-17 14:51:11 +00:00
boot Preceed/preceeding are not english words. Use precede or preceding. 2001-02-18 10:25:42 +00:00
cam 1. The key SSD_KEY_RECOVERED_ERROR is not an error at all and should 2001-02-11 23:46:54 +00:00
coda Mechanical change to use <sys/queue.h> macro API instead of 2001-02-04 13:13:25 +00:00
compat Allow debugging output to be controlled on a per-syscall granularity. 2001-02-16 16:40:43 +00:00
compile
conf This time really fix the machine/lock.h thing. This time don't fool make 2001-02-20 09:37:00 +00:00
contrib fix duplicate rcsid 2001-02-04 15:25:15 +00:00
crypto
ddb
dev Typo fixes: prefered -> preferred 2001-02-20 10:30:22 +00:00
fs Remove a debug printf. 2001-02-18 09:16:49 +00:00
geom Fix a braino in ccd's clone routine. 2001-01-29 06:18:14 +00:00
gnu Preceed/preceeding are not english words. Use precede or preceding. 2001-02-18 10:25:42 +00:00
i4b Preceed/preceeding are not english words. Use precede or preceding. 2001-02-18 10:25:42 +00:00
i386 - Add a new ithread_schedule() function to do the bulk of the work of 2001-02-20 10:25:29 +00:00
ia64 Correct disordering which is corresponding to bde's fix to 2001-02-17 14:51:11 +00:00
isa Fixed style bugs in clock.c rev.1.164 and cpu.h rev.1.52-1.53 -- declare 2001-02-19 03:00:34 +00:00
isofs/cd9660 Add a hook for loading of a Unicode -> char conversion routine as a kld at a 2001-02-13 11:48:31 +00:00
kern - In the KTR_EXTEND case, use a const char * to point to the passed in 2001-02-20 10:39:55 +00:00
libkern RIP <machine/lock.h>. 2001-02-11 10:44:09 +00:00
miscfs Extend kqueue down to the device layer. 2001-02-15 16:34:11 +00:00
modules Hook up the linux module for alpha again. 2001-02-20 02:19:01 +00:00
msdosfs Change and clean the mutex lock interface. 2001-02-09 06:11:45 +00:00
net Insert entropy harvesting calls for network traffic. By 2001-02-18 17:54:52 +00:00
netatalk Mechanical change to use <sys/queue.h> macro API instead of 2001-02-04 13:13:25 +00:00
netatm Preceed/preceeding are not english words. Use precede and preceding. 2001-02-18 10:43:53 +00:00
netgraph Preceed/preceeding are not english words. Use precede and preceding. 2001-02-18 10:43:53 +00:00
netinet Switch to using a struct xucred instead of a struct xucred when not 2001-02-18 13:30:20 +00:00
netinet6 Better detection of duplicated initialization. 2001-02-20 10:23:25 +00:00
netipx Another round of the <sys/queue.h> FOREACH transmogriffer. 2001-02-04 16:08:18 +00:00
netkey fixed possibility of panic at key_acquire(). 2001-01-14 17:25:08 +00:00
netnatm Mechanical change to use <sys/queue.h> macro API instead of 2001-02-04 13:13:25 +00:00
netncp Implement m_getm() which will perform an "all or nothing" mbuf + cluster 2001-02-14 05:13:04 +00:00
netns
nfs Switch to using a struct xucred instead of a struct xucred when not 2001-02-18 13:30:20 +00:00
nfsclient Switch to using a struct xucred instead of a struct xucred when not 2001-02-18 13:30:20 +00:00
nfsserver Switch to using a struct xucred instead of a struct xucred when not 2001-02-18 13:30:20 +00:00
ntfs Change and clean the mutex lock interface. 2001-02-09 06:11:45 +00:00
nwfs Change and clean the mutex lock interface. 2001-02-09 06:11:45 +00:00
pc98 Preceed/preceeding are not english words. Use precede and preceding. 2001-02-18 10:43:53 +00:00
pccard Move ti1031 to the 16-bit bridge section 2001-02-07 01:16:40 +00:00
pci Take luigi's suggestion and move the check for nothing to do to before the 2001-02-20 04:43:59 +00:00
posix4 Implement a unified run queue and adjust priority levels accordingly. 2001-02-12 00:20:08 +00:00
powerpc - Don't call clear_resched() in userret(), instead, clear the resched flag 2001-02-20 05:26:15 +00:00
rpc
svr4
sys - In the KTR_EXTEND case, use a const char * to point to the passed in 2001-02-20 10:39:55 +00:00
tools
ufs This patch corrects two problems with the rate limiting code 2001-02-20 11:14:38 +00:00
vm Implement a unified run queue and adjust priority levels accordingly. 2001-02-12 00:20:08 +00:00
Makefile