diff options
Diffstat (limited to 'fs/ufs')
-rw-r--r-- | fs/ufs/truncate.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/fs/ufs/truncate.c b/fs/ufs/truncate.c index f294c44577dc..3733057e7833 100644 --- a/fs/ufs/truncate.c +++ b/fs/ufs/truncate.c | |||
@@ -501,12 +501,10 @@ out: | |||
501 | return err; | 501 | return err; |
502 | } | 502 | } |
503 | 503 | ||
504 | |||
505 | /* | 504 | /* |
506 | * We don't define our `inode->i_op->truncate', and call it here, | 505 | * TODO: |
507 | * because of: | 506 | * - truncate case should use proper ordering instead of using |
508 | * - there is no way to know old size | 507 | * simple_setsize |
509 | * - there is no way inform user about error, if it happens in `truncate' | ||
510 | */ | 508 | */ |
511 | int ufs_setattr(struct dentry *dentry, struct iattr *attr) | 509 | int ufs_setattr(struct dentry *dentry, struct iattr *attr) |
512 | { | 510 | { |
@@ -530,7 +528,7 @@ int ufs_setattr(struct dentry *dentry, struct iattr *attr) | |||
530 | if (ia_valid & ATTR_SIZE && attr->ia_size != inode->i_size) { | 528 | if (ia_valid & ATTR_SIZE && attr->ia_size != inode->i_size) { |
531 | loff_t old_i_size = inode->i_size; | 529 | loff_t old_i_size = inode->i_size; |
532 | 530 | ||
533 | error = vmtruncate(inode, attr->ia_size); | 531 | error = simple_setsize(inode, attr->ia_size); |
534 | if (error) | 532 | if (error) |
535 | return error; | 533 | return error; |
536 | error = ufs_truncate(inode, old_i_size); | 534 | error = ufs_truncate(inode, old_i_size); |