Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 361594
b: refs/heads/master
c: 232ec87
h: refs/heads/master
v: v3
  • Loading branch information
Lukas Czerner authored and Theodore Ts'o committed Mar 11, 2013
1 parent d46d0f0 commit 7056146
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 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: bb8b20ed94bc69120e31399c43cb336300dea109
refs/heads/master: 232ec8720d4e45405e37144c67053042c6b886d3
12 changes: 9 additions & 3 deletions trunk/fs/ext4/extents.c
Original file line number Diff line number Diff line change
Expand Up @@ -4165,9 +4165,6 @@ int ext4_ext_map_blocks(handle_t *handle, struct inode *inode,
}
} else {
BUG_ON(allocated_clusters < reserved_clusters);
/* We will claim quota for all newly allocated blocks.*/
ext4_da_update_reserve_space(inode, allocated_clusters,
1);
if (reserved_clusters < allocated_clusters) {
struct ext4_inode_info *ei = EXT4_I(inode);
int reservation = allocated_clusters -
Expand Down Expand Up @@ -4218,6 +4215,15 @@ int ext4_ext_map_blocks(handle_t *handle, struct inode *inode,
ei->i_reserved_data_blocks += reservation;
spin_unlock(&ei->i_block_reservation_lock);
}
/*
* We will claim quota for all newly allocated blocks.
* We're updating the reserved space *after* the
* correction above so we do not accidentally free
* all the metadata reservation because we might
* actually need it later on.
*/
ext4_da_update_reserve_space(inode, allocated_clusters,
1);
}
}

Expand Down

0 comments on commit 7056146

Please sign in to comment.