diff options
Diffstat (limited to 'fs/ntfs/inode.c')
-rw-r--r-- | fs/ntfs/inode.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/ntfs/inode.c b/fs/ntfs/inode.c index 1d27331e6fc9..d3e118cc6ffa 100644 --- a/fs/ntfs/inode.c +++ b/fs/ntfs/inode.c | |||
@@ -2866,9 +2866,11 @@ conv_err_out: | |||
2866 | * | 2866 | * |
2867 | * See ntfs_truncate() description above for details. | 2867 | * See ntfs_truncate() description above for details. |
2868 | */ | 2868 | */ |
2869 | #ifdef NTFS_RW | ||
2869 | void ntfs_truncate_vfs(struct inode *vi) { | 2870 | void ntfs_truncate_vfs(struct inode *vi) { |
2870 | ntfs_truncate(vi); | 2871 | ntfs_truncate(vi); |
2871 | } | 2872 | } |
2873 | #endif | ||
2872 | 2874 | ||
2873 | /** | 2875 | /** |
2874 | * ntfs_setattr - called from notify_change() when an attribute is being changed | 2876 | * ntfs_setattr - called from notify_change() when an attribute is being changed |
@@ -2914,8 +2916,10 @@ int ntfs_setattr(struct dentry *dentry, struct iattr *attr) | |||
2914 | NInoCompressed(ni) ? | 2916 | NInoCompressed(ni) ? |
2915 | "compressed" : "encrypted"); | 2917 | "compressed" : "encrypted"); |
2916 | err = -EOPNOTSUPP; | 2918 | err = -EOPNOTSUPP; |
2917 | } else | 2919 | } else { |
2918 | err = vmtruncate(vi, attr->ia_size); | 2920 | truncate_setsize(vi, attr->ia_size); |
2921 | ntfs_truncate_vfs(vi); | ||
2922 | } | ||
2919 | if (err || ia_valid == ATTR_SIZE) | 2923 | if (err || ia_valid == ATTR_SIZE) |
2920 | goto out; | 2924 | goto out; |
2921 | } else { | 2925 | } else { |