Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3121bfe7 authored by Miklos Szeredi's avatar Miklos Szeredi
Browse files

fuse: fix "direct_io" private mmap



MAP_PRIVATE mmap could return stale data from the cache for
"direct_io" files.  Fix this by flushing the cache on mmap. 

Found with a slightly modified fsx-linux.

Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
parent ce60a2f1
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1298,6 +1298,8 @@ static int fuse_direct_mmap(struct file *file, struct vm_area_struct *vma)
	if (vma->vm_flags & VM_MAYSHARE)
		return -ENODEV;

	invalidate_inode_pages2(file->f_mapping);

	return generic_file_mmap(file, vma);
}