diff options
author | Felix Blyakher <felixb@sgi.com> | 2009-04-01 17:58:39 -0400 |
---|---|---|
committer | Felix Blyakher <felixb@sgi.com> | 2009-04-01 17:58:39 -0400 |
commit | f36345ff9a4a77f2cc576a2777b6256d5c8798fa (patch) | |
tree | 7ae4c607f6baae74060c2e385f744e171fbbf92b /fs/ext4/file.c | |
parent | 1aacc064e029f0017384e463121b98f06d3a2cc3 (diff) | |
parent | 8b53ef33d9d8fa5f771ae11cc6a6e7bc0182beec (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into for-linus
Diffstat (limited to 'fs/ext4/file.c')
-rw-r--r-- | fs/ext4/file.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/ext4/file.c b/fs/ext4/file.c index f731cb545a03..588af8c77246 100644 --- a/fs/ext4/file.c +++ b/fs/ext4/file.c | |||
@@ -33,9 +33,14 @@ | |||
33 | */ | 33 | */ |
34 | static int ext4_release_file(struct inode *inode, struct file *filp) | 34 | static int ext4_release_file(struct inode *inode, struct file *filp) |
35 | { | 35 | { |
36 | if (EXT4_I(inode)->i_state & EXT4_STATE_DA_ALLOC_CLOSE) { | ||
37 | ext4_alloc_da_blocks(inode); | ||
38 | EXT4_I(inode)->i_state &= ~EXT4_STATE_DA_ALLOC_CLOSE; | ||
39 | } | ||
36 | /* if we are the last writer on the inode, drop the block reservation */ | 40 | /* if we are the last writer on the inode, drop the block reservation */ |
37 | if ((filp->f_mode & FMODE_WRITE) && | 41 | if ((filp->f_mode & FMODE_WRITE) && |
38 | (atomic_read(&inode->i_writecount) == 1)) | 42 | (atomic_read(&inode->i_writecount) == 1) && |
43 | !EXT4_I(inode)->i_reserved_data_blocks) | ||
39 | { | 44 | { |
40 | down_write(&EXT4_I(inode)->i_data_sem); | 45 | down_write(&EXT4_I(inode)->i_data_sem); |
41 | ext4_discard_preallocations(inode); | 46 | ext4_discard_preallocations(inode); |