Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 331618
b: refs/heads/master
c: 1c9114f
h: refs/heads/master
v: v3
  • Loading branch information
Dmitry Monakhov authored and Theodore Ts'o committed Sep 29, 2012
1 parent d817556 commit 989c959
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 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: 17335dcc471199717839b2fa3492ca36f70f1168
refs/heads/master: 1c9114f9c0f10f58dd7e568a7152025af47b27e5
7 changes: 5 additions & 2 deletions trunk/fs/ext4/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -4283,7 +4283,6 @@ int ext4_setattr(struct dentry *dentry, struct iattr *attr)
}

if (attr->ia_valid & ATTR_SIZE) {
inode_dio_wait(inode);

if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))) {
struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);
Expand Down Expand Up @@ -4332,8 +4331,12 @@ int ext4_setattr(struct dentry *dentry, struct iattr *attr)
}

if (attr->ia_valid & ATTR_SIZE) {
if (attr->ia_size != i_size_read(inode))
if (attr->ia_size != i_size_read(inode)) {
truncate_setsize(inode, attr->ia_size);
/* Inode size will be reduced, wait for dio in flight */
if (orphan)
inode_dio_wait(inode);
}
ext4_truncate(inode);
}

Expand Down

0 comments on commit 989c959

Please sign in to comment.