diff options
Diffstat (limited to 'fs/ntfs/inode.c')
-rw-r--r-- | fs/ntfs/inode.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/fs/ntfs/inode.c b/fs/ntfs/inode.c index a1682342baa6..b24f4c4b2c5c 100644 --- a/fs/ntfs/inode.c +++ b/fs/ntfs/inode.c | |||
@@ -2845,8 +2845,7 @@ int ntfs_setattr(struct dentry *dentry, struct iattr *attr) | |||
2845 | 2845 | ||
2846 | err = inode_change_ok(vi, attr); | 2846 | err = inode_change_ok(vi, attr); |
2847 | if (err) | 2847 | if (err) |
2848 | return err; | 2848 | goto out; |
2849 | |||
2850 | /* We do not support NTFS ACLs yet. */ | 2849 | /* We do not support NTFS ACLs yet. */ |
2851 | if (ia_valid & (ATTR_UID | ATTR_GID | ATTR_MODE)) { | 2850 | if (ia_valid & (ATTR_UID | ATTR_GID | ATTR_MODE)) { |
2852 | ntfs_warning(vi->i_sb, "Changes in user/group/mode are not " | 2851 | ntfs_warning(vi->i_sb, "Changes in user/group/mode are not " |
@@ -2854,14 +2853,22 @@ int ntfs_setattr(struct dentry *dentry, struct iattr *attr) | |||
2854 | err = -EOPNOTSUPP; | 2853 | err = -EOPNOTSUPP; |
2855 | goto out; | 2854 | goto out; |
2856 | } | 2855 | } |
2857 | |||
2858 | if (ia_valid & ATTR_SIZE) { | 2856 | if (ia_valid & ATTR_SIZE) { |
2859 | if (attr->ia_size != i_size_read(vi)) { | 2857 | if (attr->ia_size != i_size_read(vi)) { |
2860 | ntfs_warning(vi->i_sb, "Changes in inode size are not " | 2858 | ntfs_inode *ni = NTFS_I(vi); |
2861 | "supported yet, ignoring."); | 2859 | /* |
2862 | err = -EOPNOTSUPP; | 2860 | * FIXME: For now we do not support resizing of |
2863 | // TODO: Implement... | 2861 | * compressed or encrypted files yet. |
2864 | // err = vmtruncate(vi, attr->ia_size); | 2862 | */ |
2863 | if (NInoCompressed(ni) || NInoEncrypted(ni)) { | ||
2864 | ntfs_warning(vi->i_sb, "Changes in inode size " | ||
2865 | "are not supported yet for " | ||
2866 | "%s files, ignoring.", | ||
2867 | NInoCompressed(ni) ? | ||
2868 | "compressed" : "encrypted"); | ||
2869 | err = -EOPNOTSUPP; | ||
2870 | } else | ||
2871 | err = vmtruncate(vi, attr->ia_size); | ||
2865 | if (err || ia_valid == ATTR_SIZE) | 2872 | if (err || ia_valid == ATTR_SIZE) |
2866 | goto out; | 2873 | goto out; |
2867 | } else { | 2874 | } else { |