linux/include
Ying Xue 57699a40b4 rhashtable: Fix race in rhashtable_destroy() and use regular work_struct
When we put our declared work task in the global workqueue with
schedule_delayed_work(), its delay parameter is always zero.
Therefore, we should define a regular work in rhashtable structure
instead of a delayed work.

By the way, we add a condition to check whether resizing functions
are NULL before cancelling the work, avoiding to cancel an
uninitialized work.

Lastly, while we wait for all work items we submitted before to run
to completion with cancel_delayed_work(), ht->mutex has been taken in
rhashtable_destroy(). Moreover, cancel_delayed_work() doesn't return
until all work items are accomplished, and when work items are
scheduled, the work's function - rht_deferred_worker() will be called.
However, as rht_deferred_worker() also needs to acquire the lock,
deadlock might happen at the moment as the lock is already held before.
So if the cancel work function is moved out of the lock covered scope,
this will avoid the deadlock.

Fixes: 97defe1 ("rhashtable: Per bucket locks & deferred expansion/shrinking")
Signed-off-by: Ying Xue <ying.xue@windriver.com>
Cc: Thomas Graf <tgraf@suug.ch>
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-01-16 01:18:51 -05:00
..
acpi
asm-generic mm: mmu_gather: use tlb->end != 0 only for TLB invalidation 2015-01-13 15:20:40 +13:00
clocksource
crypto
drm
dt-bindings
keys
kvm
linux rhashtable: Fix race in rhashtable_destroy() and use regular work_struct 2015-01-16 01:18:51 -05:00
math-emu
media
memory
misc
net Here's a big pile of changes for this round. 2015-01-15 19:16:56 -05:00
pcmcia
ras
rdma
rxrpc
scsi
soc
sound
target target: Drop left-over fabric_max_sectors attribute 2015-01-09 15:22:05 -08:00
trace net: rename vlan_tx_* helpers since "tx" is misleading there 2015-01-13 17:51:08 -05:00
uapi Here's a big pile of changes for this round. 2015-01-15 19:16:56 -05:00
video
xen Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-01-15 00:53:17 -05:00
Kbuild