diff options
-rw-r--r-- | fs/btrfs/ctree.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 579124043d9b..6cd4e929bd4d 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c | |||
@@ -1656,8 +1656,8 @@ static int noinline insert_new_root(struct btrfs_trans_handle *trans, | |||
1656 | 1656 | ||
1657 | c = btrfs_alloc_free_block(trans, root, root->nodesize, | 1657 | c = btrfs_alloc_free_block(trans, root, root->nodesize, |
1658 | root->root_key.objectid, | 1658 | root->root_key.objectid, |
1659 | root_gen, lower_key.objectid, level, | 1659 | root_gen, le64_to_cpu(lower_key.objectid), |
1660 | root->node->start, 0); | 1660 | level, root->node->start, 0); |
1661 | if (IS_ERR(c)) | 1661 | if (IS_ERR(c)) |
1662 | return PTR_ERR(c); | 1662 | return PTR_ERR(c); |
1663 | 1663 | ||
@@ -2352,8 +2352,9 @@ again: | |||
2352 | 2352 | ||
2353 | right = btrfs_alloc_free_block(trans, root, root->leafsize, | 2353 | right = btrfs_alloc_free_block(trans, root, root->leafsize, |
2354 | root->root_key.objectid, | 2354 | root->root_key.objectid, |
2355 | root_gen, disk_key.objectid, 0, | 2355 | root_gen, |
2356 | l->start, 0); | 2356 | le64_to_cpu(disk_key.objectid), |
2357 | 0, l->start, 0); | ||
2357 | if (IS_ERR(right)) { | 2358 | if (IS_ERR(right)) { |
2358 | BUG_ON(1); | 2359 | BUG_ON(1); |
2359 | return PTR_ERR(right); | 2360 | return PTR_ERR(right); |