summaryrefslogtreecommitdiffstats
path: root/fs/fuse/inode.c
diff options
context:
space:
mode:
authorMiklos Szeredi2007-10-17 08:31:01 +0200
committerLinus Torvalds2007-10-17 17:43:03 +0200
commitb10099792b6276c31cee4c021e0a5d3f9a9e33ed (patch)
treec90873999de5936d27b0a10e61c4de3b742bf401 /fs/fuse/inode.c
parentfuse: truncate on spontaneous size change (diff)
downloadkernel-qcow2-linux-b10099792b6276c31cee4c021e0a5d3f9a9e33ed.tar.gz
kernel-qcow2-linux-b10099792b6276c31cee4c021e0a5d3f9a9e33ed.tar.xz
kernel-qcow2-linux-b10099792b6276c31cee4c021e0a5d3f9a9e33ed.zip
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 <mszeredi@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/fuse/inode.c')
-rw-r--r--fs/fuse/inode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index b584de33a6a7..e8d360add50a 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -143,7 +143,7 @@ void fuse_change_attributes(struct inode *inode, struct fuse_attr *attr)
if (S_ISREG(inode->i_mode) && oldsize != attr->size) {
if (attr->size < oldsize)
fuse_truncate(inode->i_mapping, attr->size);
- invalidate_mapping_pages(inode->i_mapping, 0, -1);
+ invalidate_inode_pages2(inode->i_mapping);
}
}