Commit 2565b271 authored by Will Deacon's avatar Will Deacon Committed by Greg Kroah-Hartman

fs: dcache: Use READ_ONCE when accessing i_dir_seq

[ Upstream commit 8cc07c80 ]

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: default avatarPeter Zijlstra <>
Signed-off-by: default avatarWill Deacon <>
Signed-off-by: default avatarAl Viro <>
Signed-off-by: default avatarSasha Levin <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent 3623c1f3
......@@ -2510,7 +2510,7 @@ struct dentry *d_alloc_parallel(struct dentry *parent,
if (unlikely(parent->d_inode->i_dir_seq != seq)) {
if (unlikely(READ_ONCE(parent->d_inode->i_dir_seq) != seq)) {
goto retry;
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment