summaryrefslogtreecommitdiff
path: root/fs/ext4/truncate.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext4/truncate.h')
-rw-r--r--fs/ext4/truncate.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/ext4/truncate.h b/fs/ext4/truncate.h
index 011ba6670..c70d06a38 100644
--- a/fs/ext4/truncate.h
+++ b/fs/ext4/truncate.h
@@ -10,8 +10,10 @@
*/
static inline void ext4_truncate_failed_write(struct inode *inode)
{
+ down_write(&EXT4_I(inode)->i_mmap_sem);
truncate_inode_pages(inode->i_mapping, inode->i_size);
ext4_truncate(inode);
+ up_write(&EXT4_I(inode)->i_mmap_sem);
}
/*