freebsd-nq/sys
Robert Watson 265de5bb62 Correct two problems relating to sorflush(), which is called to flush
read socket buffers in shutdown() and close():

- Call socantrcvmore() before sblock() to dislodge any threads that
  might be sleeping (potentially indefinitely) while holding sblock(),
  such as a thread blocked in recv().

- Flag the sblock() call as non-interruptible so that a signal
  delivered to the thread calling sorflush() doesn't cause sblock() to
  fail.  The sblock() is required to ensure that all other socket
  consumer threads have, in fact, left, and do not enter, the socket
  buffer until we're done flushin it.

To implement the latter, change the 'flags' argument to sblock() to
accept two flags, SBL_WAIT and SBL_NOINTR, rather than one M_WAITOK
flag.  When SBL_NOINTR is set, it forces a non-interruptible sx
acquisition, regardless of the setting of the disposition of SB_NOINTR
on the socket buffer; without this change it would be possible for
another thread to clear SB_NOINTR between when the socket buffer mutex
is released and sblock() is invoked.

Reviewed by:	bz, kmacy
Reported by:	Jos Backus <jos at catnook dot com>
2008-01-31 08:22:24 +00:00
..
amd64 Add a wrapper function that bound checks writes to the dump device. 2008-01-28 19:04:07 +00:00
arm Bring in the nice work from Mark Tinguely on arm pmap. 2008-01-31 00:05:40 +00:00
boot Bump manpage date for rev 1.27 2008-01-16 07:00:55 +00:00
bsm Merge OpenBSM 1.0 changes to src/sys/bsm: 2007-10-29 18:47:25 +00:00
cam Correct the kernel config hint in a printf statement. 2008-01-28 18:13:03 +00:00
cddl - Reduce how much ZFS caches by default. This is another change to mitigate 2008-01-24 11:24:16 +00:00
compat Change type of kmem_used() and kmem_size() functions to uint64_t, so it 2008-01-24 11:21:54 +00:00
conf Enable ofwdump on powerpc (finally). Tested on G3 & G4 machines. 2008-01-31 01:57:33 +00:00
contrib - Reduce how much ZFS caches by default. This is another change to mitigate 2008-01-24 11:24:16 +00:00
crypto Make test00 compilable again. 2008-01-15 18:34:47 +00:00
ddb Increase maximum DDB capture buffer size to 5MB. 2008-01-26 23:02:14 +00:00
dev Fix link state handling in bfe(4). 2008-01-29 02:15:11 +00:00
fs Remove Giant acquisition around soreceive() and sosend() in fifofs. The 2008-01-26 12:34:23 +00:00
gdb Add kdb_cpu_sync_icache(), intended to synchronize instruction 2007-06-09 21:55:17 +00:00
geom Various fixes: 2007-12-24 01:01:59 +00:00
gnu Cleanup lockmgr interface and exported KPI: 2008-01-24 12:34:30 +00:00
i4b Spelling fix for interupt -> interrupt 2007-10-12 06:03:46 +00:00
i386 Add a wrapper function that bound checks writes to the dump device. 2008-01-28 19:04:07 +00:00
ia64 Add a wrapper function that bound checks writes to the dump device. 2008-01-28 19:04:07 +00:00
isa Use cpu_spinwait() (i.e., "pause") when spinning on rdtsc during DELAY(). 2008-01-17 18:59:38 +00:00
kern Correct two problems relating to sorflush(), which is called to flush 2008-01-31 08:22:24 +00:00
libkern Do not use __XSCALE__ to detect if clz is available, use _ARM_ARCH_5 instead. 2007-10-13 12:05:36 +00:00
modules Add a driver for the National Semiconductor DP83815, DP83843 and 2008-01-27 01:10:41 +00:00
net Remove a chunk of duplicated code, test the destination address against the 2008-01-18 09:34:09 +00:00
net80211 update channel flag defs to match _ieee80211.h so cpp doesn't complain 2007-12-13 01:23:40 +00:00
netatalk Annotate two possible bugs in a comment: (1) we allocate and explicitly 2007-11-20 18:50:54 +00:00
netatm Disconnect netatm from the build as it is not MPSAFE and relies on 2007-07-14 21:49:24 +00:00
netgraph Avoid data copying when it is possible. 2008-01-28 22:37:17 +00:00
netinet Correct two problems relating to sorflush(), which is called to flush 2008-01-31 08:22:24 +00:00
netinet6 Replace the last susers calls in netinet6/ with privilege checks. 2008-01-24 08:25:59 +00:00
netipsec Add sysctls to if_enc(4) to control whether the firewalls or 2007-11-28 22:33:53 +00:00
netipx Make tcpstates[] static, and make sure TCPSTATES is defined before 2007-07-30 11:06:42 +00:00
netnatm s/destory/destroy/ (except for the code in contrib/). 2007-04-16 12:31:35 +00:00
netncp Cleanup lockmgr interface and exported KPI: 2008-01-24 12:34:30 +00:00
netsmb Cleanup lockmgr interface and exported KPI: 2008-01-24 12:34:30 +00:00
nfs NFSv4 client: 2006-11-28 19:33:28 +00:00
nfs4client Cleanup lockmgr interface and exported KPI: 2008-01-24 12:34:30 +00:00
nfsclient Cleanup lockmgr interface and exported KPI: 2008-01-24 12:34:30 +00:00
nfsserver Use nfsrv_destroycache() only once, else it crashes the server. 2008-01-18 17:03:36 +00:00
opencrypto Make ftruncate a 'struct file' operation rather than a vnode operation. 2008-01-07 20:05:19 +00:00
pc98 Add COMPAT_FREEBSD7 and enable it in configs that have COMPAT_FREEBSD6. 2008-01-07 21:40:11 +00:00
pccard
pci Add copyrights. 2008-01-21 13:26:33 +00:00
powerpc One of my powerbooks has this chip in it.. 2008-01-26 05:11:09 +00:00
rpc Remove the now-unused NET_{LOCK,UNLOCK,ASSERT}_GIANT() macros, which 2007-08-06 14:26:03 +00:00
security Make sure that the termid type is initialized to AU_IPv4 by default. 2008-01-28 17:33:46 +00:00
sparc64 Add a wrapper function that bound checks writes to the dump device. 2008-01-28 19:04:07 +00:00
sun4v Add a wrapper function that bound checks writes to the dump device. 2008-01-28 19:04:07 +00:00
sys Correct two problems relating to sorflush(), which is called to flush 2008-01-31 08:22:24 +00:00
tools Catch up with ACPI-CA 20070320 import. 2007-03-22 18:16:43 +00:00
ufs Cleanup lockmgr interface and exported KPI: 2008-01-24 12:34:30 +00:00
vm VOP_LOCK1() (and so VOP_LOCK()) and VOP_UNLOCK() are only used in 2008-01-13 14:44:15 +00:00
Makefile o Add boot, gdb, nfsserver and opencrypto dirs to CSCOPEDIRS; sort. 2008-01-23 08:50:34 +00:00