tree 092a83bc7f351bdd66aafee0f59fddba982b4317
parent 45323fb76465a9576220c7427dbac7b1e7ad3caf
author Miklos Szeredi <[EMAIL PROTECTED]> Sat, 10 Sep 2005 03:10:38 -0700
committer Linus Torvalds <[EMAIL PROTECTED]> Sat, 10 Sep 2005 04:03:47 -0700

[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 <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>

 fs/fuse/dir.c   |    2 ++
 fs/fuse/file.c  |   10 ++++++----
 fs/fuse/inode.c |    1 +
 3 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -552,6 +552,7 @@ static int fuse_readdir(struct file *fil
                                    filldir);
 
        __free_page(page);
+       fuse_invalidate_attr(inode); /* atime changed */
        return err;
 }
 
@@ -585,6 +586,7 @@ static char *read_link(struct dentry *de
                link[req->out.args[0].size] = '\0';
  out:
        fuse_put_request(fc, req);
+       fuse_invalidate_attr(inode); /* atime changed */
        return link;
 }
 
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -244,6 +244,7 @@ static int fuse_readpage(struct file *fi
        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 *f
        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
                        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 fil
                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;
 }
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -173,6 +173,7 @@ struct inode *fuse_iget(struct super_blo
                return NULL;
 
        if ((inode->i_state & I_NEW)) {
+               inode->i_flags |= S_NOATIME|S_NOCMTIME;
                inode->i_generation = generation;
                inode->i_data.backing_dev_info = &fc->bdi;
                fuse_init_inode(inode, attr);
-
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