diff options
author | Miklos Szeredi <miklos@szeredi.hu> | 2005-09-09 16:10:38 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-09 17:03:47 -0400 |
commit | b36c31ba95f0fe0a03c727300d9c4c54438a5636 (patch) | |
tree | 092a83bc7f351bdd66aafee0f59fddba982b4317 /fs | |
parent | 45323fb76465a9576220c7427dbac7b1e7ad3caf (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')
-rw-r--r-- | fs/fuse/dir.c | 2 | ||||
-rw-r--r-- | fs/fuse/file.c | 10 | ||||
-rw-r--r-- | fs/fuse/inode.c | 1 |
3 files changed, 9 insertions, 4 deletions
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index cf5d1faed7af..9b43fd46aaad 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c | |||
@@ -552,6 +552,7 @@ static int fuse_readdir(struct file *file, void *dstbuf, filldir_t filldir) | |||
552 | filldir); | 552 | filldir); |
553 | 553 | ||
554 | __free_page(page); | 554 | __free_page(page); |
555 | fuse_invalidate_attr(inode); /* atime changed */ | ||
555 | return err; | 556 | return err; |
556 | } | 557 | } |
557 | 558 | ||
@@ -585,6 +586,7 @@ static char *read_link(struct dentry *dentry) | |||
585 | link[req->out.args[0].size] = '\0'; | 586 | link[req->out.args[0].size] = '\0'; |
586 | out: | 587 | out: |
587 | fuse_put_request(fc, req); | 588 | fuse_put_request(fc, req); |
589 | fuse_invalidate_attr(inode); /* atime changed */ | ||
588 | return link; | 590 | return link; |
589 | } | 591 | } |
590 | 592 | ||
diff --git a/fs/fuse/file.c b/fs/fuse/file.c index a8dc88527fbe..6dcae74ce7fa 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) | |||
244 | fuse_put_request(fc, req); | 244 | fuse_put_request(fc, req); |
245 | if (!err) | 245 | if (!err) |
246 | SetPageUptodate(page); | 246 | SetPageUptodate(page); |
247 | fuse_invalidate_attr(inode); /* atime changed */ | ||
247 | out: | 248 | out: |
248 | unlock_page(page); | 249 | unlock_page(page); |
249 | return err; | 250 | return err; |
@@ -312,6 +313,7 @@ static int fuse_readpages(struct file *file, struct address_space *mapping, | |||
312 | if (!err && data.req->num_pages) | 313 | if (!err && data.req->num_pages) |
313 | err = fuse_send_readpages(data.req, file, inode); | 314 | err = fuse_send_readpages(data.req, file, inode); |
314 | fuse_put_request(fc, data.req); | 315 | fuse_put_request(fc, data.req); |
316 | fuse_invalidate_attr(inode); /* atime changed */ | ||
315 | return err; | 317 | return err; |
316 | } | 318 | } |
317 | 319 | ||
@@ -380,8 +382,8 @@ static int fuse_commit_write(struct file *file, struct page *page, | |||
380 | clear_page_dirty(page); | 382 | clear_page_dirty(page); |
381 | SetPageUptodate(page); | 383 | SetPageUptodate(page); |
382 | } | 384 | } |
383 | } else if (err == -EINTR || err == -EIO) | 385 | } |
384 | fuse_invalidate_attr(inode); | 386 | fuse_invalidate_attr(inode); |
385 | return err; | 387 | return err; |
386 | } | 388 | } |
387 | 389 | ||
@@ -473,8 +475,8 @@ static ssize_t fuse_direct_io(struct file *file, const char __user *buf, | |||
473 | if (write && pos > i_size_read(inode)) | 475 | if (write && pos > i_size_read(inode)) |
474 | i_size_write(inode, pos); | 476 | i_size_write(inode, pos); |
475 | *ppos = pos; | 477 | *ppos = pos; |
476 | } else if (write && (res == -EINTR || res == -EIO)) | 478 | } |
477 | fuse_invalidate_attr(inode); | 479 | fuse_invalidate_attr(inode); |
478 | 480 | ||
479 | return res; | 481 | return res; |
480 | } | 482 | } |
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index 8dc66760b41a..52e954f4bb91 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c | |||
@@ -173,6 +173,7 @@ struct inode *fuse_iget(struct super_block *sb, unsigned long nodeid, | |||
173 | return NULL; | 173 | return NULL; |
174 | 174 | ||
175 | if ((inode->i_state & I_NEW)) { | 175 | if ((inode->i_state & I_NEW)) { |
176 | inode->i_flags |= S_NOATIME|S_NOCMTIME; | ||
176 | inode->i_generation = generation; | 177 | inode->i_generation = generation; |
177 | inode->i_data.backing_dev_info = &fc->bdi; | 178 | inode->i_data.backing_dev_info = &fc->bdi; |
178 | fuse_init_inode(inode, attr); | 179 | fuse_init_inode(inode, attr); |