Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b10099792b6276c31cee4c021e0a5d3f9a9e33ed
Commit:     b10099792b6276c31cee4c021e0a5d3f9a9e33ed
Parent:     e00d2c2d4aead747d0fbee99001b00612d1082b0
Author:     Miklos Szeredi <[EMAIL PROTECTED]>
AuthorDate: Tue Oct 16 23:31:01 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Wed Oct 17 08:43:03 2007 -0700

    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 <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 fs/fuse/file.c  |    2 +-
 fs/fuse/inode.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 90ce7c5..fb1713e 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);
 }
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index b584de3..e8d360a 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);
        }
 }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to