Btrfs: bugfix in btrfs_find_parent_nodes
[deliverable/linux.git] / fs / btrfs / backref.c
index b41d94a6471b5fc4c7ed7d26781a7fcc05f60d11..c69a846999bf7601bd37fdada1d32d1d29221101 100644 (file)
@@ -413,7 +413,7 @@ static int __add_inline_refs(struct btrfs_fs_info *fs_info,
         * enumerate all inline refs
         */
        leaf = path->nodes[0];
-       slot = path->slots[0] - 1;
+       slot = path->slots[0];
 
        item_size = btrfs_item_size_nr(leaf, slot);
        BUG_ON(item_size < sizeof(*ei));
@@ -661,8 +661,9 @@ again:
                struct extent_buffer *leaf;
                int slot;
 
+               path->slots[0]--;
                leaf = path->nodes[0];
-               slot = path->slots[0] - 1;
+               slot = path->slots[0];
                btrfs_item_key_to_cpu(leaf, &key, slot);
                if (key.objectid == bytenr &&
                    key.type == BTRFS_EXTENT_ITEM_KEY) {
This page took 0.0256 seconds and 5 git commands to generate.