Skip to content

Commit

Permalink
Btrfs: Copy correct tree when inserting into slot 0
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
Chris Mason committed Sep 25, 2008
1 parent b3236e6 commit 5a01a2e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fs/btrfs/ctree.c
Original file line number Diff line number Diff line change
Expand Up @@ -2443,13 +2443,16 @@ int btrfs_insert_empty_items(struct btrfs_trans_handle *trans,
btrfs_mark_buffer_dirty(leaf);

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);
}

if (btrfs_leaf_free_space(root, leaf) < 0) {
btrfs_print_leaf(root, leaf);
BUG();
}

out:
return ret;
}
Expand Down

0 comments on commit 5a01a2e

Please sign in to comment.