aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext4/inode.c')
-rw-r--r--fs/ext4/inode.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 8dd3d5de5861..80ed6dc9c9d2 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -3901,6 +3901,9 @@ void ext4_truncate(struct inode *inode)
3901 if (!ext4_can_truncate(inode)) 3901 if (!ext4_can_truncate(inode))
3902 return; 3902 return;
3903 3903
3904 if (inode->i_size == 0)
3905 ei->i_state |= EXT4_STATE_DA_ALLOC_CLOSE;
3906
3904 if (EXT4_I(inode)->i_flags & EXT4_EXTENTS_FL) { 3907 if (EXT4_I(inode)->i_flags & EXT4_EXTENTS_FL) {
3905 ext4_ext_truncate(inode); 3908 ext4_ext_truncate(inode);
3906 return; 3909 return;