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:52:03 +0000 (07:52 +0200)
commit2565b271aed0199f5ff977429486e3b59e68e708
tree5373b355805a84b424fcb94311856c0fcb489049
parent3623c1f37efaf6ab2eed458a2ad11e49ebc2e08b
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