diff options
| author | Filipe Manana <[email protected]> | 2022-08-22 14:47:09 +0000 |
|---|---|---|
| committer | David Sterba <[email protected]> | 2022-08-23 20:15:21 +0000 |
| commit | 47bf225a8d2cccb15f7e8d4a1ed9b757dd86afd7 (patch) | |
| tree | 6871a9c89880e6f50bd43ea87d9b7ac566d4da10 /fs/btrfs/dev-replace.c | |
| parent | btrfs: fix space cache corruption and potential double allocations (diff) | |
| download | kernel-47bf225a8d2cccb15f7e8d4a1ed9b757dd86afd7.tar.gz kernel-47bf225a8d2cccb15f7e8d4a1ed9b757dd86afd7.zip | |
btrfs: fix silent failure when deleting root reference
At btrfs_del_root_ref(), if btrfs_search_slot() returns an error, we end
up returning from the function with a value of 0 (success). This happens
because the function returns the value stored in the variable 'err',
which is 0, while the error value we got from btrfs_search_slot() is
stored in the 'ret' variable.
So fix it by setting 'err' with the error value.
Fixes: 8289ed9f93bef2 ("btrfs: replace the BUG_ON in btrfs_del_root_ref with proper error handling")
CC: [email protected] # 5.16+
Reviewed-by: Qu Wenruo <[email protected]>
Signed-off-by: Filipe Manana <[email protected]>
Reviewed-by: David Sterba <[email protected]>
Signed-off-by: David Sterba <[email protected]>
Diffstat (limited to 'fs/btrfs/dev-replace.c')
0 files changed, 0 insertions, 0 deletions
