Commit 5a01a2e3 authored by Chris Mason's avatar Chris Mason

Btrfs: Copy correct tree when inserting into slot 0

Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent b3236e68
...@@ -2443,13 +2443,16 @@ int btrfs_insert_empty_items(struct btrfs_trans_handle *trans, ...@@ -2443,13 +2443,16 @@ int btrfs_insert_empty_items(struct btrfs_trans_handle *trans,
btrfs_mark_buffer_dirty(leaf); btrfs_mark_buffer_dirty(leaf);
ret = 0; ret = 0;
if (slot == 0) if (slot == 0) {
btrfs_cpu_key_to_disk(&disk_key, cpu_key);
ret = fixup_low_keys(trans, root, path, &disk_key, 1); ret = fixup_low_keys(trans, root, path, &disk_key, 1);
}
if (btrfs_leaf_free_space(root, leaf) < 0) { if (btrfs_leaf_free_space(root, leaf) < 0) {
btrfs_print_leaf(root, leaf); btrfs_print_leaf(root, leaf);
BUG(); BUG();
} }
out: out:
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment