mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 05:31:08 -04:00
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 <[email protected]> Signed-off-by: Will Deacon <[email protected]> Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
1 parent
015555fd4d
commit
8cc07c808c
1 file changed
+1
-1
+1
-1
@@ -2507,7 +2507,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;
|
||||
|
||||
Reference in new issue
Block a user