diff options
Diffstat (limited to 'fs/hfs/inode.c')
-rw-r--r-- | fs/hfs/inode.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c index 8df18e63eb6b..87de671baa83 100644 --- a/fs/hfs/inode.c +++ b/fs/hfs/inode.c | |||
@@ -612,10 +612,16 @@ int hfs_inode_setattr(struct dentry *dentry, struct iattr * attr) | |||
612 | attr->ia_mode = inode->i_mode & ~S_IWUGO; | 612 | attr->ia_mode = inode->i_mode & ~S_IWUGO; |
613 | attr->ia_mode &= S_ISDIR(inode->i_mode) ? ~hsb->s_dir_umask: ~hsb->s_file_umask; | 613 | attr->ia_mode &= S_ISDIR(inode->i_mode) ? ~hsb->s_dir_umask: ~hsb->s_file_umask; |
614 | } | 614 | } |
615 | error = inode_setattr(inode, attr); | ||
616 | if (error) | ||
617 | return error; | ||
618 | 615 | ||
616 | if ((attr->ia_valid & ATTR_SIZE) && | ||
617 | attr->ia_size != i_size_read(inode)) { | ||
618 | error = vmtruncate(inode, attr->ia_size); | ||
619 | if (error) | ||
620 | return error; | ||
621 | } | ||
622 | |||
623 | setattr_copy(inode, attr); | ||
624 | mark_inode_dirty(inode); | ||
619 | return 0; | 625 | return 0; |
620 | } | 626 | } |
621 | 627 | ||