Revert "btrfs-progs: Do metadata preallocation as long as we're not modifying extent tree"

Commit 7a12d8470e ("btrfs-progs: Do metadata preallocation as long as
we're not modifying extent tree") tries to fix #123, however due to the
fact that chunk tree also has root->ref_cows set, we will call
do_chunk_alloc() until call stack explodes.

So revert that offending patch until we have a much better comment on
root->ref_cows and find a better solution to this problem.

Signed-off-by: Qu Wenruo <wqu@suse.com>
master
Qu Wenruo 2019-04-16 09:04:43 +08:00
parent 6ab19825b0
commit 4ab95eb8b0
1 changed files with 1 additions and 6 deletions

View File

@ -2506,12 +2506,7 @@ int btrfs_reserve_extent(struct btrfs_trans_handle *trans,
profile = BTRFS_BLOCK_GROUP_METADATA | alloc_profile;
}
/*
* Do metadata preallocation if we're not modifying the extent tree.
* Allocating chunk while modifying extent tree could lead to transid
* mismatch, as do_chunk_alloc() could commit transaction.
*/
if (root->root_key.objectid != BTRFS_EXTENT_TREE_OBJECTID) {
if (root->ref_cows) {
if (!(profile & BTRFS_BLOCK_GROUP_METADATA)) {
ret = do_chunk_alloc(trans, info,
num_bytes,