mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-25 05:04:09 +08:00
btrfs: handle btrfs_search_slot failure in replace_path
The search can fail for various reasons, in case of errors there's no cleanup to be done so we can pass the error to the caller, adjusting for the case where the key is not found and search slot returns 1. Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: David Sterba <dsterba@suse.com> [ update changelog ] Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
45b87c5d25
commit
0e9873e2fe
@ -1323,7 +1323,11 @@ again:
|
|||||||
path->lowest_level = level;
|
path->lowest_level = level;
|
||||||
ret = btrfs_search_slot(trans, src, &key, path, 0, 1);
|
ret = btrfs_search_slot(trans, src, &key, path, 0, 1);
|
||||||
path->lowest_level = 0;
|
path->lowest_level = 0;
|
||||||
BUG_ON(ret);
|
if (ret) {
|
||||||
|
if (ret > 0)
|
||||||
|
ret = -ENOENT;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Info qgroup to trace both subtrees.
|
* Info qgroup to trace both subtrees.
|
||||||
|
Loading…
Reference in New Issue
Block a user