Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 251744
b: refs/heads/master
c: 072bd7e
h: refs/heads/master
v: v3
  • Loading branch information
Theodore Ts'o committed May 23, 2011
1 parent 0f143c6 commit a579a29
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 28e35e42fb255cbaeee8b9f89643f26fe376374d
refs/heads/master: 072bd7ea74d4b60149a33967d29666bbd84e7709
16 changes: 8 additions & 8 deletions trunk/fs/ext4/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -5309,8 +5309,7 @@ int ext4_setattr(struct dentry *dentry, struct iattr *attr)

if (S_ISREG(inode->i_mode) &&
attr->ia_valid & ATTR_SIZE &&
(attr->ia_size < inode->i_size ||
(ext4_test_inode_flag(inode, EXT4_INODE_EOFBLOCKS)))) {
(attr->ia_size < inode->i_size)) {
handle_t *handle;

handle = ext4_journal_start(inode, 3);
Expand Down Expand Up @@ -5344,14 +5343,15 @@ int ext4_setattr(struct dentry *dentry, struct iattr *attr)
goto err_out;
}
}
/* ext4_truncate will clear the flag */
if ((ext4_test_inode_flag(inode, EXT4_INODE_EOFBLOCKS)))
ext4_truncate(inode);
}

if ((attr->ia_valid & ATTR_SIZE) &&
attr->ia_size != i_size_read(inode))
rc = vmtruncate(inode, attr->ia_size);
if (attr->ia_valid & ATTR_SIZE) {
if (attr->ia_size != i_size_read(inode)) {
truncate_setsize(inode, attr->ia_size);
ext4_truncate(inode);
} else if (ext4_test_inode_flag(inode, EXT4_INODE_EOFBLOCKS))
ext4_truncate(inode);
}

if (!rc) {
setattr_copy(inode, attr);
Expand Down

0 comments on commit a579a29

Please sign in to comment.