summaryrefslogtreecommitdiffstats
path: root/fs/ceph
diff options
context:
space:
mode:
authorAndrea Parri <andrea.parri@amarulasolutions.com>2019-05-20 19:23:58 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-08-06 19:08:07 +0200
commitf7d3cd5a75a5f807e4ea80cff28ce1ff4832021e (patch)
tree09025a778a13bc2ef016a38086d4d9b17dcb748a /fs/ceph
parentd5fc61f4f7f1c6a8346f70e9b9c688547766b1b8 (diff)
downloadlinux-stable-f7d3cd5a75a5f807e4ea80cff28ce1ff4832021e.tar.gz
linux-stable-f7d3cd5a75a5f807e4ea80cff28ce1ff4832021e.tar.bz2
linux-stable-f7d3cd5a75a5f807e4ea80cff28ce1ff4832021e.zip
ceph: fix improper use of smp_mb__before_atomic()
[ Upstream commit 749607731e26dfb2558118038c40e9c0c80d23b5 ] This barrier only applies to the read-modify-write operations; in particular, it does not apply to the atomic64_set() primitive. Replace the barrier with an smp_mb(). Fixes: fdd4e15838e59 ("ceph: rework dcache readdir") Reported-by: "Paul E. McKenney" <paulmck@linux.ibm.com> Reported-by: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Andrea Parri <andrea.parri@amarulasolutions.com> Reviewed-by: "Yan, Zheng" <zyan@redhat.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs/ceph')
-rw-r--r--fs/ceph/super.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/ceph/super.h b/fs/ceph/super.h
index edec39aa5ce2..1d313d0536f9 100644
--- a/fs/ceph/super.h
+++ b/fs/ceph/super.h
@@ -544,7 +544,12 @@ static inline void __ceph_dir_set_complete(struct ceph_inode_info *ci,
long long release_count,
long long ordered_count)
{
- smp_mb__before_atomic();
+ /*
+ * Makes sure operations that setup readdir cache (update page
+ * cache and i_size) are strongly ordered w.r.t. the following
+ * atomic64_set() operations.
+ */
+ smp_mb();
atomic64_set(&ci->i_complete_seq[0], release_count);
atomic64_set(&ci->i_complete_seq[1], ordered_count);
}