From b10099792b6276c31cee4c021e0a5d3f9a9e33ed Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Tue, 16 Oct 2007 23:31:01 -0700 Subject: fuse: fix page invalidation Other than truncate, there are two cases, when fuse tries to get rid of cached pages: a) in open, if KEEP_CACHE flag is not set b) in getattr, if file size changed spontaneously Until now invalidate_mapping_pages() were used, which didn't get rid of mapped pages. This is wrong, and becomes more wrong as dirty pages are introduced. So instead properly invalidate all pages with invalidate_inode_pages2(). Signed-off-by: Miklos Szeredi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- fs/fuse/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs/fuse/file.c') diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 90ce7c5f7b5..fb1713e7675 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -87,7 +87,7 @@ void fuse_finish_open(struct inode *inode, struct file *file, if (outarg->open_flags & FOPEN_DIRECT_IO) file->f_op = &fuse_direct_io_file_operations; if (!(outarg->open_flags & FOPEN_KEEP_CACHE)) - invalidate_mapping_pages(inode->i_mapping, 0, -1); + invalidate_inode_pages2(inode->i_mapping); ff->fh = outarg->fh; file->private_data = fuse_file_get(ff); } -- cgit v1.2.2