summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--root-tree.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/root-tree.c b/root-tree.c
index c10d0684..ef2190fc 100644
--- a/root-tree.c
+++ b/root-tree.c
@@ -92,6 +92,11 @@ int btrfs_insert_root(struct btrfs_trans_handle *trans, struct btrfs_root
*item)
{
int ret;
+
+ /*
+ * Make sure generation v1 and v2 match. See update_root for details.
+ */
+ btrfs_set_root_generation_v2(item, btrfs_root_generation(item));
ret = btrfs_insert_item(trans, root, key, item, sizeof(*item));
return ret;
}