aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-01-30 11:43:54 -0500
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:04:00 -0400
commit5a01a2e3a9d4dc9cb4871dde4d832a3b8de9f748 (patch)
treee7f65c9f72bc998e2c3ee30df4f191864684938b /fs/btrfs/ctree.c
parentb3236e68bf86b3ae87f58984a1822369225211cb (diff)
Btrfs: Copy correct tree when inserting into slot 0
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.c')
-rw-r--r--fs/btrfs/ctree.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index fb2e2bd506c8..cf32651876bf 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -2443,13 +2443,16 @@ int btrfs_insert_empty_items(struct btrfs_trans_handle *trans,
2443 btrfs_mark_buffer_dirty(leaf); 2443 btrfs_mark_buffer_dirty(leaf);
2444 2444
2445 ret = 0; 2445 ret = 0;
2446 if (slot == 0) 2446 if (slot == 0) {
2447 btrfs_cpu_key_to_disk(&disk_key, cpu_key);
2447 ret = fixup_low_keys(trans, root, path, &disk_key, 1); 2448 ret = fixup_low_keys(trans, root, path, &disk_key, 1);
2449 }
2448 2450
2449 if (btrfs_leaf_free_space(root, leaf) < 0) { 2451 if (btrfs_leaf_free_space(root, leaf) < 0) {
2450 btrfs_print_leaf(root, leaf); 2452 btrfs_print_leaf(root, leaf);
2451 BUG(); 2453 BUG();
2452 } 2454 }
2455
2453out: 2456out:
2454 return ret; 2457 return ret;
2455} 2458}