提交 2f375ab9 编写于 作者: Y Yan 提交者: Chris Mason

Call btrfs_cow_block while lowering tree level.

When freeing root block of a tree,  btrfs_free_extent' parameter
'ref_generation' is from root block itseft.  When freeing non-root
block,  'ref_generation' is from its parent. so when converting a
non-root block to root block, we must guarantee its generation is
equal to its parent's generation.
Signed-off-by: NChris Mason <chris.mason@oracle.com>
上级 60cde612
...@@ -720,6 +720,9 @@ static int balance_level(struct btrfs_trans_handle *trans, ...@@ -720,6 +720,9 @@ static int balance_level(struct btrfs_trans_handle *trans,
/* promote the child to a root */ /* promote the child to a root */
child = read_node_slot(root, mid, 0); child = read_node_slot(root, mid, 0);
BUG_ON(!child); BUG_ON(!child);
ret = btrfs_cow_block(trans, root, child, mid, 0, &child);
BUG_ON(ret);
root->node = child; root->node = child;
path->nodes[level] = NULL; path->nodes[level] = NULL;
clean_tree_block(trans, root, mid); clean_tree_block(trans, root, mid);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册