From: J. Bruce Fields Date: Tue, 4 Jan 2011 19:12:47 +0000 (-0500) Subject: svcrpc: ensure cache_check caller sees updated entry X-Git-Tag: v2.6.38-rc1~51^2~31 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fdef7aa5d4020fd94ffcbf0078d6bd9e5a111e19;p=pandora-kernel.git svcrpc: ensure cache_check caller sees updated entry Supposes cache_check runs simultaneously with an update on a different CPU: cache_check task doing update ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ 1. test for CACHE_VALID 1'. set entry->data & !CACHE_NEGATIVE 2. use entry->data 2'. set CACHE_VALID If the two memory writes performed in step 1' and 2' appear misordered with respect to the reads in step 1 and 2, then the caller could get stale data at step 2 even though it saw CACHE_VALID set on the cache entry. Add memory barriers to prevent this. Reviewed-by: NeilBrown Signed-off-by: J. Bruce Fields --- Reading git-diff-tree failed