Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 262090
b: refs/heads/master
c: 7132de7
h: refs/heads/master
v: v3
  • Loading branch information
Maxim Patlasov authored and Theodore Ts'o committed Jul 10, 2011
1 parent 814efe2 commit 85ad5b8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 275d3ba6b40d0f098693b9089c6fee9bd4e55d74
refs/heads/master: 7132de744ba76930d13033061018ddd7e3e8cd91
1 change: 1 addition & 0 deletions trunk/fs/ext4/ext4.h
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@ struct ext4_new_group_data {
#define EXT4_FREE_BLOCKS_METADATA 0x0001
#define EXT4_FREE_BLOCKS_FORGET 0x0002
#define EXT4_FREE_BLOCKS_VALIDATED 0x0004
#define EXT4_FREE_BLOCKS_NO_QUOT_UPDATE 0x0008

/*
* ioctl commands
Expand Down
4 changes: 3 additions & 1 deletion trunk/fs/ext4/extents.c
Original file line number Diff line number Diff line change
Expand Up @@ -3565,12 +3565,14 @@ int ext4_ext_map_blocks(handle_t *handle, struct inode *inode,

err = ext4_ext_insert_extent(handle, inode, path, &newex, flags);
if (err) {
int fb_flags = flags & EXT4_GET_BLOCKS_DELALLOC_RESERVE ?
EXT4_FREE_BLOCKS_NO_QUOT_UPDATE : 0;
/* free data blocks we just allocated */
/* not a good idea to call discard here directly,
* but otherwise we'd need to call it every free() */
ext4_discard_preallocations(inode);
ext4_free_blocks(handle, inode, NULL, ext4_ext_pblock(&newex),
ext4_ext_get_actual_len(&newex), 0);
ext4_ext_get_actual_len(&newex), fb_flags);
goto out2;
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/ext4/mballoc.c
Original file line number Diff line number Diff line change
Expand Up @@ -4637,7 +4637,7 @@ void ext4_free_blocks(handle_t *handle, struct inode *inode,
}
ext4_mark_super_dirty(sb);
error_return:
if (freed)
if (freed && !(flags & EXT4_FREE_BLOCKS_NO_QUOT_UPDATE))
dquot_free_block(inode, freed);
brelse(bitmap_bh);
ext4_std_error(sb, err);
Expand Down

0 comments on commit 85ad5b8

Please sign in to comment.