mirror of
https://github.com/kdave/btrfs-progs
synced 2025-02-19 03:06:50 +00:00
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>
This commit is contained in:
parent
6ab19825b0
commit
4ab95eb8b0
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user