summaryrefslogtreecommitdiff
path: root/ctree.c
diff options
context:
space:
mode:
Diffstat (limited to 'ctree.c')
-rw-r--r--ctree.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ctree.c b/ctree.c
index 88ebd9ec..d172875a 100644
--- a/ctree.c
+++ b/ctree.c
@@ -122,6 +122,7 @@ int btrfs_copy_root(struct btrfs_trans_handle *trans,
btrfs_set_header_bytenr(cow, cow->start);
btrfs_set_header_generation(cow, trans->transid);
btrfs_set_header_owner(cow, new_root_objectid);
+ btrfs_clear_header_flag(cow, BTRFS_HEADER_FLAG_WRITTEN);
WARN_ON(btrfs_header_generation(buf) > trans->transid);
ret = btrfs_inc_ref(trans, new_root, buf);
@@ -181,6 +182,7 @@ int __btrfs_cow_block(struct btrfs_trans_handle *trans,
btrfs_set_header_bytenr(cow, cow->start);
btrfs_set_header_generation(cow, trans->transid);
btrfs_set_header_owner(cow, root->root_key.objectid);
+ btrfs_clear_header_flag(cow, BTRFS_HEADER_FLAG_WRITTEN);
WARN_ON(btrfs_header_generation(buf) > trans->transid);
if (btrfs_header_generation(buf) != trans->transid) {
@@ -242,6 +244,10 @@ int btrfs_cow_block(struct btrfs_trans_handle *trans,
WARN_ON(1);
}
if (btrfs_header_generation(buf) == trans->transid) {
+#if 0
+ &&
+ !btrfs_header_flag(buf, BTRFS_HEADER_FLAG_WRITTEN)) {
+#endif
*cow_ret = buf;
return 0;
}
@@ -1463,6 +1469,7 @@ static int split_node(struct btrfs_trans_handle *trans, struct btrfs_root
btrfs_set_header_bytenr(split, split->start);
btrfs_set_header_generation(split, trans->transid);
btrfs_set_header_owner(split, root->root_key.objectid);
+ btrfs_set_header_flags(split, 0);
write_extent_buffer(split, root->fs_info->fsid,
(unsigned long)btrfs_header_fsid(split),
BTRFS_FSID_SIZE);