|
@@ -39,7 +39,8 @@ static int ext4_release_file(struct inode *inode, struct file *filp)
|
|
}
|
|
}
|
|
/* if we are the last writer on the inode, drop the block reservation */
|
|
/* if we are the last writer on the inode, drop the block reservation */
|
|
if ((filp->f_mode & FMODE_WRITE) &&
|
|
if ((filp->f_mode & FMODE_WRITE) &&
|
|
- (atomic_read(&inode->i_writecount) == 1))
|
|
|
|
|
|
+ (atomic_read(&inode->i_writecount) == 1) &&
|
|
|
|
+ !EXT4_I(inode)->i_reserved_data_blocks)
|
|
{
|
|
{
|
|
down_write(&EXT4_I(inode)->i_data_sem);
|
|
down_write(&EXT4_I(inode)->i_data_sem);
|
|
ext4_discard_preallocations(inode);
|
|
ext4_discard_preallocations(inode);
|