From: Ying Xue Date: Thu, 27 Mar 2014 04:54:39 +0000 (+0800) Subject: tipc: use node list lock to protect tipc_num_links variable X-Git-Tag: v3.15-rc1~113^2~66^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dde2026608fbf24e1687a2b62c4752022f429252;p=pandora-kernel.git tipc: use node list lock to protect tipc_num_links variable Without properly implicit or explicit read memory barrier, it's unsafe to read an atomic variable with atomic_read() from another thread which is different with the thread of changing the atomic variable with atomic_inc() or atomic_dec(). So a stale tipc_num_links may be got with atomic_read() in tipc_node_get_links(). If the tipc_num_links variable type is converted from atomic to unsigned integer and node list lock is used to protect it, the issue would be avoided. Signed-off-by: Ying Xue Reviewed-by: Erik Hugne Reviewed-by: Jon Maloy Signed-off-by: David S. Miller --- Reading git-diff-tree failed