diff options
author | Yan <yanzheng@21cn.com> | 2008-02-01 14:58:07 -0500 |
---|---|---|
committer | David Woodhouse <dwmw2@hera.kernel.org> | 2008-02-01 14:58:07 -0500 |
commit | ece29db27976fb78f0294ebe69a2b50161cc98a3 (patch) | |
tree | 72218ba7b1b1be95cb07774d2553b0b638c49187 /ctree.c | |
parent | d2255c7c2f20bc5fc953317d851da8e38da92563 (diff) | |
download | btrfs-progs-ece29db27976fb78f0294ebe69a2b50161cc98a3.tar.gz |
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.
Diffstat (limited to 'ctree.c')
-rw-r--r-- | ctree.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -686,6 +686,9 @@ static int balance_level(struct btrfs_trans_handle *trans, /* promote the child to a root */ child = read_node_slot(root, mid, 0); BUG_ON(!child); + ret = btrfs_cow_block(trans, root, child, mid, 0, &child); + BUG_ON(ret); + root->node = child; path->nodes[level] = NULL; clean_tree_block(trans, root, mid); |