From: Chris Mason Date: Wed, 30 Jan 2008 16:43:54 +0000 (-0500) Subject: Btrfs: Copy correct tree when inserting into slot 0 X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=5a01a2e3a9d4dc9cb4871dde4d832a3b8de9f748;p=deliverable%2Flinux.git Btrfs: Copy correct tree when inserting into slot 0 Signed-off-by: Chris Mason --- 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, 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; }