Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.com>2018-11-01 14:04:41 +1100
committerNeilBrown <neilb@suse.com>2018-11-01 14:05:14 +1100
commit00bcaec491353f4d755e4d1bdbc0fef2108bc103 (patch)
tree47619d974b355811fde97293cc3cf025797ef4a5
parent3252d2eeebb8b92987e95a3162e35dfa0c0d8034 (diff)
fs: dcache: Use READ_ONCE when accessing i_dir_seq (git-fixes).
-rw-r--r--patches.fixes/fs-dcache-Use-READ_ONCE-when-accessing-i_dir_seq.patch31
-rw-r--r--series.conf1
2 files changed, 32 insertions, 0 deletions
diff --git a/patches.fixes/fs-dcache-Use-READ_ONCE-when-accessing-i_dir_seq.patch b/patches.fixes/fs-dcache-Use-READ_ONCE-when-accessing-i_dir_seq.patch
new file mode 100644
index 0000000000..fa3b0ec32d
--- /dev/null
+++ b/patches.fixes/fs-dcache-Use-READ_ONCE-when-accessing-i_dir_seq.patch
@@ -0,0 +1,31 @@
+From: Will Deacon <will.deacon@arm.com>
+Date: Mon, 19 Feb 2018 14:55:55 +0000
+Subject: [PATCH] fs: dcache: Use READ_ONCE when accessing i_dir_seq
+Git-commit: 8cc07c808c9d595e81cbe5aad419b7769eb2e5c9
+Patch-mainline: v4.16
+References: git-fixes
+
+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>
+Acked-by: NeilBrown <neilb@suse.com>
+
+---
+ fs/dcache.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/fs/dcache.c
++++ b/fs/dcache.c
+@@ -2492,7 +2492,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;
diff --git a/series.conf b/series.conf
index 8828dc9a26..2b1e362a9d 100644
--- a/series.conf
+++ b/series.conf
@@ -13795,6 +13795,7 @@
patches.drivers/ASoC-wm_adsp-For-TLV-controls-only-register-TLV-get-
patches.fixes/lock_parent-needs-to-recheck-if-dentry-got-__dentry_.patch
patches.fixes/fs-dcache-Avoid-livelock-between-d_alloc_parallel-an.patch
+ patches.fixes/fs-dcache-Use-READ_ONCE-when-accessing-i_dir_seq.patch
patches.fixes/0005-fs-Teach-path_connected-to-handle-nfs-filesystems-wi.patch
patches.drivers/drm-amdgpu-fix-prime-teardown-order
patches.drivers/drm-radeon-fix-prime-teardown-order