summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiu Bo <bo.li.liu@oracle.com>2013-06-22 13:32:41 +0800
committerChris Mason <chris.mason@fusionio.com>2013-07-03 14:16:09 -0400
commit699e69b7bd7b6a4736e8e7efc61db6ce43e8014e (patch)
tree556c1294e52d5adc786ef6f74a38a6f3f371f78b
parentf00dd8386a57d241d0f7c72653f7ffad118dc5ae (diff)
Btrfs-progs: fix misuse of skinny metadata in btrfs-image
As for skinny metadata, key.offset stores levels rather than extent length. Signed-off-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
-rw-r--r--btrfs-image.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/btrfs-image.c b/btrfs-image.c
index 22239fe4..30c1a9af 100644
--- a/btrfs-image.c
+++ b/btrfs-image.c
@@ -1169,9 +1169,9 @@ static int copy_from_extent_tree(struct metadump_struct *metadump,
bytenr = key.objectid;
if (key.type == BTRFS_METADATA_ITEM_KEY)
- num_bytes = key.offset;
- else
num_bytes = extent_root->leafsize;
+ else
+ num_bytes = key.offset;
if (btrfs_item_size_nr(leaf, path->slots[0]) > sizeof(*ei)) {
ei = btrfs_item_ptr(leaf, path->slots[0],