aboutsummaryrefslogtreecommitdiff
path: root/fs/fuse/file.c
diff options
context:
space:
mode:
authorMiklos Szeredi <miklos@szeredi.hu>2005-09-09 13:10:38 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-09 14:03:47 -0700
commitb36c31ba95f0fe0a03c727300d9c4c54438a5636 (patch)
tree092a83bc7f351bdd66aafee0f59fddba982b4317 /fs/fuse/file.c
parent45323fb76465a9576220c7427dbac7b1e7ad3caf (diff)
[PATCH] fuse: don't update file times
Don't change mtime/ctime/atime to local time on read/write. Rather invalidate file attributes, so next stat() will force a GETATTR call. Bug reported by Ben Grimm. Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/fuse/file.c')
-rw-r--r--fs/fuse/file.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index a8dc88527fb..6dcae74ce7f 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -244,6 +244,7 @@ static int fuse_readpage(struct file *file, struct page *page)
fuse_put_request(fc, req);
if (!err)
SetPageUptodate(page);
+ fuse_invalidate_attr(inode); /* atime changed */
out:
unlock_page(page);
return err;
@@ -312,6 +313,7 @@ static int fuse_readpages(struct file *file, struct address_space *mapping,
if (!err && data.req->num_pages)
err = fuse_send_readpages(data.req, file, inode);
fuse_put_request(fc, data.req);
+ fuse_invalidate_attr(inode); /* atime changed */
return err;
}
@@ -380,8 +382,8 @@ static int fuse_commit_write(struct file *file, struct page *page,
clear_page_dirty(page);
SetPageUptodate(page);
}
- } else if (err == -EINTR || err == -EIO)
- fuse_invalidate_attr(inode);
+ }
+ fuse_invalidate_attr(inode);
return err;
}
@@ -473,8 +475,8 @@ static ssize_t fuse_direct_io(struct file *file, const char __user *buf,
if (write && pos > i_size_read(inode))
i_size_write(inode, pos);
*ppos = pos;
- } else if (write && (res == -EINTR || res == -EIO))
- fuse_invalidate_attr(inode);
+ }
+ fuse_invalidate_attr(inode);
return res;
}