diff options
author | Ying Xue <ying.xue@windriver.com> | 2014-03-27 12:54:39 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-03-27 13:08:38 -0400 |
commit | dde2026608fbf24e1687a2b62c4752022f429252 (patch) | |
tree | 829cd112db96c7c1e7fcacb9544f36703c06ac4a /block/blk-sysfs.c | |
parent | 2220646a53aa588798653232e26172ec36ab06cd (diff) | |
download | linux-dde2026608fbf24e1687a2b62c4752022f429252.tar.gz linux-dde2026608fbf24e1687a2b62c4752022f429252.tar.bz2 linux-dde2026608fbf24e1687a2b62c4752022f429252.zip |
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 <ying.xue@windriver.com>
Reviewed-by: Erik Hugne <erik.hugne@ericsson.com>
Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'block/blk-sysfs.c')
0 files changed, 0 insertions, 0 deletions