aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fuse/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/fuse/inode.c')
-rw-r--r--fs/fuse/inode.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index 7d0a9aee01f2..8e106163aaed 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -109,6 +109,7 @@ static int fuse_remount_fs(struct super_block *sb, int *flags, char *data)
109 109
110void fuse_change_attributes(struct inode *inode, struct fuse_attr *attr) 110void fuse_change_attributes(struct inode *inode, struct fuse_attr *attr)
111{ 111{
112 struct fuse_conn *fc = get_fuse_conn(inode);
112 if (S_ISREG(inode->i_mode) && i_size_read(inode) != attr->size) 113 if (S_ISREG(inode->i_mode) && i_size_read(inode) != attr->size)
113 invalidate_inode_pages(inode->i_mapping); 114 invalidate_inode_pages(inode->i_mapping);
114 115
@@ -117,7 +118,9 @@ void fuse_change_attributes(struct inode *inode, struct fuse_attr *attr)
117 inode->i_nlink = attr->nlink; 118 inode->i_nlink = attr->nlink;
118 inode->i_uid = attr->uid; 119 inode->i_uid = attr->uid;
119 inode->i_gid = attr->gid; 120 inode->i_gid = attr->gid;
121 spin_lock(&fc->lock);
120 i_size_write(inode, attr->size); 122 i_size_write(inode, attr->size);
123 spin_unlock(&fc->lock);
121 inode->i_blocks = attr->blocks; 124 inode->i_blocks = attr->blocks;
122 inode->i_atime.tv_sec = attr->atime; 125 inode->i_atime.tv_sec = attr->atime;
123 inode->i_atime.tv_nsec = attr->atimensec; 126 inode->i_atime.tv_nsec = attr->atimensec;
@@ -130,7 +133,7 @@ void fuse_change_attributes(struct inode *inode, struct fuse_attr *attr)
130static void fuse_init_inode(struct inode *inode, struct fuse_attr *attr) 133static void fuse_init_inode(struct inode *inode, struct fuse_attr *attr)
131{ 134{
132 inode->i_mode = attr->mode & S_IFMT; 135 inode->i_mode = attr->mode & S_IFMT;
133 i_size_write(inode, attr->size); 136 inode->i_size = attr->size;
134 if (S_ISREG(inode->i_mode)) { 137 if (S_ISREG(inode->i_mode)) {
135 fuse_init_common(inode); 138 fuse_init_common(inode);
136 fuse_init_file_inode(inode); 139 fuse_init_file_inode(inode);