fs: dcache: Use READ_ONCE when accessing i_dir_seq
authorWill Deacon <will.deacon@arm.com>
Mon, 19 Feb 2018 14:55:55 +0000 (14:55 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 May 2018 05:50:30 +0000 (07:50 +0200)
commit527ed41ff2776311bdae56c2472ee0a5cbb60605
treeca36c8027febb2a7811ca2950bd552c805c1e43d
parentbcefedb87cf9625d33d0e53dfdc52e43744593c1
fs: dcache: Use READ_ONCE when accessing i_dir_seq

[ Upstream commit 8cc07c808c9d595e81cbe5aad419b7769eb2e5c9 ]

i_dir_seq is subject to concurrent modification by a cmpxchg or
store-release operation, so ensure that the relaxed access in
d_alloc_parallel uses READ_ONCE.

Reported-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/dcache.c