mirror of
https://github.com/kdave/btrfs-progs
synced 2024-12-25 23:52:17 +00:00
btrfs-progs: Preserve process_one_leaf return value.
The return value in process_one_leaf could be over-written while looping over the items in the leaf. This patch will preserve a non-zero return value to the calling function if a non-zero return value is encountered in the loop. The return value of one (1) is consistent with non-zero values that could be returned while processing the leaf. The only caller of this function (walk_down_tree) would ignore the return value anyway. But this patch will correct the behaviour in case future changes intend to utilize the return value. Signed-off-by: Mitch Harder <mitch.harder@sabayonlinux.org> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <clm@fb.com>
This commit is contained in:
parent
771040bb35
commit
5218123d8f
@ -1219,6 +1219,7 @@ static int process_one_leaf(struct btrfs_root *root, struct extent_buffer *eb,
|
||||
u32 nritems;
|
||||
int i;
|
||||
int ret = 0;
|
||||
int error = 0;
|
||||
struct cache_tree *inode_cache;
|
||||
struct shared_node *active_node;
|
||||
|
||||
@ -1268,8 +1269,10 @@ static int process_one_leaf(struct btrfs_root *root, struct extent_buffer *eb,
|
||||
default:
|
||||
break;
|
||||
};
|
||||
if (ret != 0)
|
||||
error = 1;
|
||||
}
|
||||
return ret;
|
||||
return error;
|
||||
}
|
||||
|
||||
static void reada_walk_down(struct btrfs_root *root,
|
||||
|
Loading…
Reference in New Issue
Block a user