diff options
author | Will Deacon <will.deacon@arm.com> | 2018-02-19 09:55:55 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2018-02-25 12:51:10 -0500 |
commit | 8cc07c808c9d595e81cbe5aad419b7769eb2e5c9 (patch) | |
tree | b67b43888c8f559aba6365fd2a9965584d626f41 /fs | |
parent | 015555fd4d2930bc0c86952c46ad88b3392f66e4 (diff) |
fs: dcache: Use READ_ONCE when accessing i_dir_seq
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>
Diffstat (limited to 'fs')
-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 bde3b6662601..8945e6cabd93 100644 --- a/fs/dcache.c +++ b/fs/dcache.c | |||
@@ -2507,7 +2507,7 @@ retry: | |||
2507 | } | 2507 | } |
2508 | 2508 | ||
2509 | hlist_bl_lock(b); | 2509 | hlist_bl_lock(b); |
2510 | if (unlikely(parent->d_inode->i_dir_seq != seq)) { | 2510 | if (unlikely(READ_ONCE(parent->d_inode->i_dir_seq) != seq)) { |
2511 | hlist_bl_unlock(b); | 2511 | hlist_bl_unlock(b); |
2512 | rcu_read_unlock(); | 2512 | rcu_read_unlock(); |
2513 | goto retry; | 2513 | goto retry; |