diff options
Diffstat (limited to 'fs/omfs/file.c')
-rw-r--r-- | fs/omfs/file.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/fs/omfs/file.c b/fs/omfs/file.c index 78c9f0c1a2f3..5542c284dc1c 100644 --- a/fs/omfs/file.c +++ b/fs/omfs/file.c | |||
@@ -349,7 +349,17 @@ static int omfs_setattr(struct dentry *dentry, struct iattr *attr) | |||
349 | error = inode_change_ok(inode, attr); | 349 | error = inode_change_ok(inode, attr); |
350 | if (error) | 350 | if (error) |
351 | return error; | 351 | return error; |
352 | return inode_setattr(inode, attr); | 352 | |
353 | if ((attr->ia_valid & ATTR_SIZE) && | ||
354 | attr->ia_size != i_size_read(inode)) { | ||
355 | error = vmtruncate(inode, attr->ia_size); | ||
356 | if (error) | ||
357 | return error; | ||
358 | } | ||
359 | |||
360 | setattr_copy(inode, attr); | ||
361 | mark_inode_dirty(inode); | ||
362 | return 0; | ||
353 | } | 363 | } |
354 | 364 | ||
355 | const struct inode_operations omfs_file_inops = { | 365 | const struct inode_operations omfs_file_inops = { |