summaryrefslogtreecommitdiff
path: root/extent-tree.c
diff options
context:
space:
mode:
authorQu Wenruo <quwenruo@cn.fujitsu.com>2015-01-28 10:12:55 +0800
committerDavid Sterba <dsterba@suse.cz>2015-02-02 19:21:24 +0100
commitccdd0a067f36b689a0928074d53e5020f3ff5f5d (patch)
treef06f2dcf7788ab6a3b1e698c1c1b13e15d0b75b3 /extent-tree.c
parent3e7524911214c4399f25ed2dabc0ad2956f7e90e (diff)
btrfs-progs: read_tree_block() and read_node_slot() cleanup.
Allow read_tree_block() and read_node_slot() to return error pointer. This should help caller to get more specified error number. For existing callers, change (!eb) judgmentt to (!extent_buffer_uptodate(eb)) to keep the compatibility, and for caller missing the check, use PTR_ERR(eb) if possible. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'extent-tree.c')
-rw-r--r--extent-tree.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/extent-tree.c b/extent-tree.c
index 080f30d3..1785e226 100644
--- a/extent-tree.c
+++ b/extent-tree.c
@@ -2962,6 +2962,13 @@ static int noinline walk_down_tree(struct btrfs_trans_handle *trans,
next = read_tree_block(root, bytenr, blocksize,
ptr_gen);
mutex_lock(&root->fs_info->fs_mutex);
+ if (!extent_buffer_uptodate(next)) {
+ if (IS_ERR(next))
+ ret = PTR_ERR(next);
+ else
+ ret = -EIO;
+ break;
+ }
}
WARN_ON(*level <= 0);
if (path->nodes[*level-1])