Merge branch 'overlayfs-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszer...
[sfrench/cifs-2.6.git] / fs / overlayfs / readdir.c
index 3e27e455a502bb88ac7ee55216fe538e74e9bd15..62e9b22a2077ac2ac9acb382dd5617a34e9e7636 100644 (file)
@@ -760,14 +760,14 @@ static int ovl_dir_fsync(struct file *file, loff_t start, loff_t end,
 
                        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))