Skip to content

Commit

Permalink
fuse: fix "direct_io" private mmap
Browse files Browse the repository at this point in the history
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: Miklos Szeredi <mszeredi@suse.cz>
  • Loading branch information
Miklos Szeredi committed Apr 9, 2009
1 parent ce60a2f commit 3121bfe
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/fuse/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 3121bfe

Please sign in to comment.