Hi Jan!
On Wed, Oct 10, 2012 at 01:21:31PM +0200, Jan Schmidt wrote:
> @@ -1574,11 +1599,22 @@ static int get_first_ref(struct send_ctx *sctx,
> goto out;
> }
>
> - iref = btrfs_item_ptr(path->nodes[0], path->slots[0],
> - struct btrfs_inode_ref);
> - len = btrfs_inode_ref_name_len(path->nodes[0], iref);
> - ret = fs_path_add_from_extent_buffer(name, path->nodes[0],
> - (unsigned long)(iref + 1), len);
> + if (key.type == BTRFS_INODE_REF_KEY) {
> + struct btrfs_inode_ref *iref;
> + iref = btrfs_item_ptr(path->nodes[0], path->slots[0],
> + struct btrfs_inode_ref);
> + len = btrfs_inode_ref_name_len(path->nodes[0], iref);
> + ret = fs_path_add_from_extent_buffer(name, path->nodes[0],
> + (unsigned long)(iref + 1),
> + len);
> + } else {
> + struct btrfs_inode_extref *extref;
> + extref = btrfs_item_ptr(path->nodes[0], path->slots[0],
> + struct btrfs_inode_extref);
> + len = btrfs_inode_extref_name_len(path->nodes[0], extref);
> + ret = fs_path_add_from_extent_buffer(name, path->nodes[0],
> + (unsigned long)&extref->name, len);
> + }
> if (ret < 0)
> goto out;
> btrfs_release_path(path);
Ok there's the following line in get_first_ref() which I believe was missed:
*dir = found_key.offset;
that will have to account for an extended ref.
The rest of the patch looks pretty good to me. Thanks for writing this up!
--Mark
--
Mark Fasheh
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html