From: Milton Miller Date: Tue, 15 Mar 2011 19:27:16 +0000 (-0600) Subject: call_function_many: fix list delete vs add race X-Git-Tag: v2.6.39-rc1~452 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e6cd1e07a185d5f9b0aa75e020df02d3c1c44940;p=pandora-kernel.git call_function_many: fix list delete vs add race Peter pointed out there was nothing preventing the list_del_rcu in smp_call_function_interrupt from running before the list_add_rcu in smp_call_function_many. Fix this by not setting refs until we have gotten the lock for the list. Take advantage of the wmb in list_add_rcu to save an explicit additional one. I tried to force this race with a udelay before the lock & list_add and by mixing all 64 online cpus with just 3 random cpus in the mask, but was unsuccessful. Still, inspection shows a valid race, and the fix is a extension of the existing protection window in the current code. Cc: stable@kernel.org (v2.6.32 and later) Reported-by: Peter Zijlstra Signed-off-by: Milton Miller Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed