diff options
author | Josef Bacik <[email protected]> | 2021-03-12 15:25:23 -0500 |
---|---|---|
committer | David Sterba <[email protected]> | 2021-04-19 17:25:21 +0200 |
commit | 0e9873e2fe43ea098e70c30c996ebb90a22cce43 (patch) | |
tree | be47dd10e7279825c6a13910555b13c0874b3208 | |
parent | 45b87c5d2557a327bb702d00040cfbf2271b56ed (diff) |
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 <[email protected]>
Signed-off-by: Josef Bacik <[email protected]>
Reviewed-by: David Sterba <[email protected]>
[ update changelog ]
Signed-off-by: David Sterba <[email protected]>
-rw-r--r-- | fs/btrfs/relocation.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index f1702157532a..b62f5e46cf34 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c @@ -1323,7 +1323,11 @@ again: path->lowest_level = level; ret = btrfs_search_slot(trans, src, &key, path, 0, 1); path->lowest_level = 0; - BUG_ON(ret); + if (ret) { + if (ret > 0) + ret = -ENOENT; + break; + } /* * Info qgroup to trace both subtrees. |