summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorFilipe David Borba Manana <fdmanana@gmail.com>2013-07-13 12:25:15 +0100
committerChris Mason <chris.mason@fusionio.com>2013-09-01 07:57:35 -0400
commit647f63bd363e5f4800bf3e85a613793e1eb4bf25 (patch)
tree0108f28153b8b72b3b5e10a5789ce6c7c8b1c659 /fs
parentccf39f92f37b0ee7d8de663fc438482f2019c4a6 (diff)
downloadlinux-647f63bd363e5f4800bf3e85a613793e1eb4bf25.tar.gz
linux-647f63bd363e5f4800bf3e85a613793e1eb4bf25.tar.bz2
linux-647f63bd363e5f4800bf3e85a613793e1eb4bf25.zip
Btrfs: add missing error checks to add_data_references
The function relocation.c:add_data_references() was not checking if all calls to __add_tree_block() and find_data_references() were succeeding or not. Signed-off-by: Filipe David Borba Manana <fdmanana@gmail.com> Reviewed-by: David Sterba <dsterba@suse.cz> Signed-off-by: Josef Bacik <jbacik@fusionio.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/relocation.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index 12096496cc99..295a6115c326 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -3628,7 +3628,7 @@ int add_data_references(struct reloc_control *rc,
unsigned long ptr;
unsigned long end;
u32 blocksize = btrfs_level_size(rc->extent_root, 0);
- int ret;
+ int ret = 0;
int err = 0;
eb = path->nodes[0];
@@ -3655,6 +3655,10 @@ int add_data_references(struct reloc_control *rc,
} else {
BUG();
}
+ if (ret) {
+ err = ret;
+ goto out;
+ }
ptr += btrfs_extent_inline_ref_size(key.type);
}
WARN_ON(ptr > end);
@@ -3700,6 +3704,7 @@ int add_data_references(struct reloc_control *rc,
}
path->slots[0]++;
}
+out:
btrfs_release_path(path);
if (err)
free_block_list(blocks);