diff options
Diffstat (limited to 'fs/ufs')
-rw-r--r-- | fs/ufs/truncate.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/ufs/truncate.c b/fs/ufs/truncate.c index ee8db3e77bfe..f294c44577dc 100644 --- a/fs/ufs/truncate.c +++ b/fs/ufs/truncate.c | |||
@@ -518,18 +518,18 @@ int ufs_setattr(struct dentry *dentry, struct iattr *attr) | |||
518 | if (error) | 518 | if (error) |
519 | return error; | 519 | return error; |
520 | 520 | ||
521 | if (is_quota_modification(inode, attr)) | ||
522 | dquot_initialize(inode); | ||
523 | |||
521 | if ((ia_valid & ATTR_UID && attr->ia_uid != inode->i_uid) || | 524 | if ((ia_valid & ATTR_UID && attr->ia_uid != inode->i_uid) || |
522 | (ia_valid & ATTR_GID && attr->ia_gid != inode->i_gid)) { | 525 | (ia_valid & ATTR_GID && attr->ia_gid != inode->i_gid)) { |
523 | error = dquot_transfer(inode, attr); | 526 | error = dquot_transfer(inode, attr); |
524 | if (error) | 527 | if (error) |
525 | return error; | 528 | return error; |
526 | } | 529 | } |
527 | if (ia_valid & ATTR_SIZE && | 530 | if (ia_valid & ATTR_SIZE && attr->ia_size != inode->i_size) { |
528 | attr->ia_size != i_size_read(inode)) { | ||
529 | loff_t old_i_size = inode->i_size; | 531 | loff_t old_i_size = inode->i_size; |
530 | 532 | ||
531 | dquot_initialize(inode); | ||
532 | |||
533 | error = vmtruncate(inode, attr->ia_size); | 533 | error = vmtruncate(inode, attr->ia_size); |
534 | if (error) | 534 | if (error) |
535 | return error; | 535 | return error; |