forked from Mirrors/btrfs-progs
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
parent
6ab19825b0
commit
4ab95eb8b0
|
@ -2506,12 +2506,7 @@ int btrfs_reserve_extent(struct btrfs_trans_handle *trans,
|
||||||
profile = BTRFS_BLOCK_GROUP_METADATA | alloc_profile;
|
profile = BTRFS_BLOCK_GROUP_METADATA | alloc_profile;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
if (root->ref_cows) {
|
||||||
* 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 (!(profile & BTRFS_BLOCK_GROUP_METADATA)) {
|
if (!(profile & BTRFS_BLOCK_GROUP_METADATA)) {
|
||||||
ret = do_chunk_alloc(trans, info,
|
ret = do_chunk_alloc(trans, info,
|
||||||
num_bytes,
|
num_bytes,
|
||||||
|
|
Loading…
Reference in New Issue