diff options
Diffstat (limited to 'fs/fuse/dir.c')
-rw-r--r-- | fs/fuse/dir.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index 9966cae5a9e5..f31c1365a013 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -1348,6 +1348,7 @@ static int fuse_do_setattr(struct dentry *entry, struct iattr *attr, { struct inode *inode = entry->d_inode; struct fuse_conn *fc = get_fuse_conn(inode); + struct fuse_inode *fi = get_fuse_inode(inode); struct fuse_req *req; struct fuse_setattr_in inarg; struct fuse_attr_out outarg; @@ -1378,8 +1379,10 @@ static int fuse_do_setattr(struct dentry *entry, struct iattr *attr, if (IS_ERR(req)) return PTR_ERR(req); - if (is_truncate) + if (is_truncate) { fuse_set_nowrite(inode); + set_bit(FUSE_I_SIZE_UNSTABLE, &fi->state); + } memset(&inarg, 0, sizeof(inarg)); memset(&outarg, 0, sizeof(outarg)); @@ -1441,12 +1444,14 @@ static int fuse_do_setattr(struct dentry *entry, struct iattr *attr, invalidate_inode_pages2(inode->i_mapping); } + clear_bit(FUSE_I_SIZE_UNSTABLE, &fi->state); return 0; error: if (is_truncate) fuse_release_nowrite(inode); + clear_bit(FUSE_I_SIZE_UNSTABLE, &fi->state); return err; } |