freebsd-dev/sys
Konstantin Belousov 28e21133f3 Prevent leak of URWLOCK_READ_WAITERS flag for urwlocks.
If there was some error, e.g. the sleep was interrupted, as in the
referenced PR, do_rw_rdlock() did not cleared URWLOCK_READ_WAITERS.
Since unlock only wakes up write waiters when there is no read
waiters, for URWLOCK_PREFER_READER kind of locks, the result was
missed wakeups for writers.

In particular, the most visible victims are ld-elf.so locks in
processes which loaded libthr, because rtld locks are urwlocks in
prefer-reader mode.  Normal rwlocks fall into prefer-reader mode only
if thread already owns rw lock in read mode, which is not typical and
correspondingly less visible.  In the PR, unowned rtld bind lock was
waited for in the process where only one thread was left alive.

Note that do_rw_wrlock() correctly clears URWLOCK_WRITE_WAITERS in
case of errors.

Reported and tested by:	longwitz@incore.de
PR:	211947
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2016-08-25 16:35:42 +00:00
..
amd64 Make execution of 32-bit CloudABI executables work on amd64. 2016-08-24 10:51:33 +00:00
arm Add support for Allwinner A64 PLL_PERIPH0/PLL_PERIPH1 and PLL_HSIC clocks. 2016-08-25 10:29:41 +00:00
arm64 Fix an assert, it should check if, when moving from 1 l1 to 512 l2 blocks, 2016-08-25 14:42:29 +00:00
boot Don't set *dev in the zfs root case, it may be NULL and will correctly be 2016-08-25 12:42:41 +00:00
bsm
cam Make the iSCSI parameter negotiation more flexible. 2016-08-25 05:22:53 +00:00
cddl Bug 212114 - loader: zio_checksum_verify() must test spa for NULL pointer 2016-08-24 16:30:15 +00:00
compat Add missing header dependency. 2016-08-24 09:57:19 +00:00
conf Add support for Allwinner A64. 2016-08-25 13:59:19 +00:00
contrib Make execution of 32-bit CloudABI executables work on amd64. 2016-08-24 10:51:33 +00:00
crypto Connect the SHA-512t256 and Skein hashing algorithms to ZFS 2016-05-31 04:12:14 +00:00
ddb In ddb ps, left justify the non-numeric fields 'state' and 'wmesg' and 2016-08-14 15:26:40 +00:00
dev Less-quick fix for locking fixes in r172250. r172250 added a second 2016-08-25 13:46:52 +00:00
fs Implement VOP_FDATASYNC() for msdosfs. 2016-08-15 19:17:00 +00:00
gdb
geom Do not invoke resize event if initial disk size is zero. Some disks 2016-08-01 20:54:54 +00:00
gnu Revert changes for local testing, inadvertantly commited in r300811. 2016-05-26 23:59:42 +00:00
i386 Convert pointers obtained from the threadattr_t structure with TO_PTR(). 2016-08-24 10:13:18 +00:00
isa
kern Prevent leak of URWLOCK_READ_WAITERS flag for urwlocks. 2016-08-25 16:35:42 +00:00
kgssapi
libkern
mips [mips] add support for the "creative" GNU extensions and IRIX hilarity around MIPS LO16/HI16 relocations. 2016-08-21 00:48:41 +00:00
modules Add a Makefile for building the cloudabi32 kernel module. 2016-08-24 11:35:49 +00:00
net hyperv/hn: Use vmbus xact for RNDIS initialize. 2016-08-25 05:00:41 +00:00
net80211 [net80211] correctly lock the ifp before accessing the lladdr. 2016-08-18 01:25:12 +00:00
netgraph Avoid panic from ng_uncallout when unpluggin ethernet cable with active 2016-08-08 19:31:01 +00:00
netinet Pass the number of segments coalesced by LRO up the stack by repurposing the 2016-08-25 13:33:32 +00:00
netinet6 Fix L2 caching for UDP over IPv6 2016-08-24 00:52:30 +00:00
netipsec Get closer to a VIMAGE network stack teardown from top to bottom rather 2016-06-21 13:48:49 +00:00
netnatm
netpfil Try to fix gcc compilation errors (which are right). 2016-08-18 10:26:15 +00:00
netsmb
nfs Hide the boottime and bootimebin globals, provide the getboottime(9) 2016-07-27 11:08:59 +00:00
nfsclient
nfsserver
nlm When sleeping waiting for either local or remote advisory lock, 2016-06-26 20:08:42 +00:00
ofed Add support for setting blocking and non-blocking mode on /dev/rdma_cm 2016-08-18 08:49:02 +00:00
opencrypto opencrypto AES-ICM: Fix heap corruption typo 2016-08-01 22:57:03 +00:00
pc98 Remove the ie(4) driver for Intel 82586 ISA Ethernet adapters. 2016-08-20 00:49:29 +00:00
powerpc Close a race when making the CPU idle under pHyp. If an interrupt occurs 2016-08-24 16:49:14 +00:00
riscv o Remove operation in machine mode. 2016-08-10 12:41:36 +00:00
rpc Hide the boottime and bootimebin globals, provide the getboottime(9) 2016-07-27 11:08:59 +00:00
security Audit the accepted (or rejected) username argument to setlogin(2). 2016-08-20 20:28:08 +00:00
sparc64 Remove the wds(4) driver for the WD700 ISA SCSI HBA. 2016-08-19 21:51:42 +00:00
sys Pass the number of segments coalesced by LRO up the stack by repurposing the 2016-08-25 13:33:32 +00:00
teken
tests
tools Consider CROSS_BINUTILS_PREFIX environment variable so we use correct 2016-08-10 13:49:17 +00:00
ufs Bug 211013 reports that a write error to a UFS filesystem running 2016-08-16 21:02:30 +00:00
vm Eliminate unneeded vm_page_xbusy() and vm_page_xunbusy() operations when 2016-08-14 22:00:45 +00:00
x86 Fix build for !SMP kernels after the Xen MSIX workaround. 2016-08-22 21:23:17 +00:00
xdr
xen xen: Correct typo in #undef for symbol NBPL 2016-06-06 14:55:46 +00:00
Makefile