diff options
Diffstat (limited to 'fs/ext2/file.c')
-rw-r--r-- | fs/ext2/file.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/ext2/file.c b/fs/ext2/file.c index ab7961260c49..c051798459a1 100644 --- a/fs/ext2/file.c +++ b/fs/ext2/file.c | |||
@@ -30,8 +30,11 @@ | |||
30 | */ | 30 | */ |
31 | static int ext2_release_file (struct inode * inode, struct file * filp) | 31 | static int ext2_release_file (struct inode * inode, struct file * filp) |
32 | { | 32 | { |
33 | if (filp->f_mode & FMODE_WRITE) | 33 | if (filp->f_mode & FMODE_WRITE) { |
34 | ext2_discard_prealloc (inode); | 34 | mutex_lock(&EXT2_I(inode)->truncate_mutex); |
35 | ext2_discard_reservation(inode); | ||
36 | mutex_unlock(&EXT2_I(inode)->truncate_mutex); | ||
37 | } | ||
35 | return 0; | 38 | return 0; |
36 | } | 39 | } |
37 | 40 | ||