diff options
-rw-r--r-- | fs/ext4/inode.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index a1c7d7623213..2d54c822c4c3 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
@@ -3494,6 +3494,9 @@ void ext4_truncate(struct inode *inode) | |||
3494 | * modify the block allocation tree. | 3494 | * modify the block allocation tree. |
3495 | */ | 3495 | */ |
3496 | down_write(&ei->i_data_sem); | 3496 | down_write(&ei->i_data_sem); |
3497 | |||
3498 | ext4_discard_reservation(inode); | ||
3499 | |||
3497 | /* | 3500 | /* |
3498 | * The orphan list entry will now protect us from any crash which | 3501 | * The orphan list entry will now protect us from any crash which |
3499 | * occurs before the truncate completes, so it is now safe to propagate | 3502 | * occurs before the truncate completes, so it is now safe to propagate |
@@ -3563,8 +3566,6 @@ do_indirects: | |||
3563 | ; | 3566 | ; |
3564 | } | 3567 | } |
3565 | 3568 | ||
3566 | ext4_discard_reservation(inode); | ||
3567 | |||
3568 | up_write(&ei->i_data_sem); | 3569 | up_write(&ei->i_data_sem); |
3569 | inode->i_mtime = inode->i_ctime = ext4_current_time(inode); | 3570 | inode->i_mtime = inode->i_ctime = ext4_current_time(inode); |
3570 | ext4_mark_inode_dirty(handle, inode); | 3571 | ext4_mark_inode_dirty(handle, inode); |