OpenCloudOS-Kernel/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 ACPI / processor: Convert apic_id to phys_id to make it arch agnostic 2015-01-05 23:32:42 +01:00
asm-generic mm: mmu_gather: use tlb->end != 0 only for TLB invalidation 2015-01-13 15:20:40 +13:00
clocksource time: move the timecounter/cyclecounter code into its own file. 2014-12-30 18:29:25 -05:00
crypto crypto: af_alg - add user space interface for AEAD 2014-12-05 23:56:55 +08:00
drm Revert "drm/gem: Warn on illegal use of the dumb buffer interface v2" 2014-12-24 13:13:22 +10:00
dt-bindings GMAC: define clock ID used for GMAC 2014-12-31 19:14:18 -05:00
keys
kvm arm/arm64: KVM: Require in-kernel vgic for the arch timers 2014-12-15 11:50:42 +01:00
linux rhashtable: Fix race in rhashtable_destroy() and use regular work_struct 2015-01-16 01:18:51 -05:00
math-emu
media [media] media: v4l2-image-sizes.h: correct the SVGA height definition 2014-12-04 13:56:56 -02:00
memory
misc
net Here's a big pile of changes for this round. 2015-01-15 19:16:56 -05:00
pcmcia
ras
rdma IB/core: Implement support for MMU notifiers regarding on demand paging regions 2014-12-15 18:13:36 -08:00
rxrpc
scsi SCSI for-linus on 20141220 2014-12-20 13:42:57 -08:00
soc Merge branch 'at91/cleanup5' into next/drivers 2014-12-08 18:29:20 +01:00
sound ALSA: pcm: Fix kerneldoc for params_*() functions 2014-12-30 16:41:11 +01:00
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 OMAPDSS: Remove all references to obsolete HDMI audio callbacks 2014-12-01 11:09:59 +02:00
xen Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-01-15 00:53:17 -05:00
Kbuild