Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1702041 > unrolled thread

[PATCH -v2 2/4] overlayfs: Remove smp_mb__before_spinlock() usage

Started byPeter Zijlstra <peterz@infradead.org>
First post2017-08-02 13:50 +0200
Last post2017-08-02 13:50 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH -v2 2/4] overlayfs: Remove smp_mb__before_spinlock() usage Peter Zijlstra <peterz@infradead.org> - 2017-08-02 13:50 +0200

#1702041 — [PATCH -v2 2/4] overlayfs: Remove smp_mb__before_spinlock() usage

FromPeter Zijlstra <peterz@infradead.org>
Date2017-08-02 13:50 +0200
Subject[PATCH -v2 2/4] overlayfs: Remove smp_mb__before_spinlock() usage
Message-ID<ua0k2-RL-23@gated-at.bofh.it>
While we could replace the smp_mb__before_spinlock() with the new
smp_mb__after_spinlock(), the normal pattern is to use
smp_store_release() to publish an object that is used for
lockless_dereference() -- and mirrors the regular rcu_assign_pointer()
/ rcu_dereference() patterns.

Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
---
 fs/overlayfs/readdir.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/fs/overlayfs/readdir.c
+++ b/fs/overlayfs/readdir.c
@@ -446,14 +446,14 @@ static int ovl_dir_fsync(struct file *fi
 
 			ovl_path_upper(dentry, &upperpath);
 			realfile = ovl_path_open(&upperpath, O_RDONLY);
-			smp_mb__before_spinlock();
+
 			inode_lock(inode);
 			if (!od->upperfile) {
 				if (IS_ERR(realfile)) {
 					inode_unlock(inode);
 					return PTR_ERR(realfile);
 				}
-				od->upperfile = realfile;
+				smp_store_release(&od->upperfile, realfile);
 			} else {
 				/* somebody has beaten us to it */
 				if (!IS_ERR(realfile))

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web