diff options
author | Will Deacon <will.deacon@arm.com> | 2018-02-19 17:55:55 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-05-30 08:52:03 +0300 |
commit | 2565b271aed0199f5ff977429486e3b59e68e708 (patch) | |
tree | 5373b355805a84b424fcb94311856c0fcb489049 /fs/dcache.c | |
parent | 3623c1f37efaf6ab2eed458a2ad11e49ebc2e08b (diff) | |
download | linux-2565b271aed0199f5ff977429486e3b59e68e708.tar.xz |
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>
Diffstat (limited to 'fs/dcache.c')
-rw-r--r-- | fs/dcache.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/dcache.c b/fs/dcache.c index e0d400c3005d..5f31a93150d1 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -2510,7 +2510,7 @@ retry: } hlist_bl_lock(b); - if (unlikely(parent->d_inode->i_dir_seq != seq)) { + if (unlikely(READ_ONCE(parent->d_inode->i_dir_seq) != seq)) { hlist_bl_unlock(b); rcu_read_unlock(); goto retry; |