X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=fs%2Foverlayfs%2Freaddir.c;h=8c8ce9d87ba35cbe02a1607f3f2565e0f2bafc56;hb=d45f00ae43e63eff1b3d79df20610ae1ef645ebd;hp=910553f37acabbc22eaa21e793784d1b1a8b5af5;hpb=54ef6df3f3f1353d99c80c437259d317b2cd1cbd;p=firefly-linux-kernel-4.4.55.git diff --git a/fs/overlayfs/readdir.c b/fs/overlayfs/readdir.c index 910553f37aca..8c8ce9d87ba3 100644 --- a/fs/overlayfs/readdir.c +++ b/fs/overlayfs/readdir.c @@ -454,12 +454,13 @@ static int ovl_dir_fsync(struct file *file, loff_t start, loff_t end, if (!od->is_upper && ovl_path_type(dentry) == OVL_PATH_MERGE) { struct inode *inode = file_inode(file); - realfile = od->upperfile; + realfile =lockless_dereference(od->upperfile); if (!realfile) { struct path upperpath; ovl_path_upper(dentry, &upperpath); realfile = ovl_path_open(&upperpath, O_RDONLY); + smp_mb__before_spinlock(); mutex_lock(&inode->i_mutex); if (!od->upperfile) { if (IS_ERR(realfile)) {