btrfs: remove duplicate error check at btrfs_convert_extent_bit()

There's no need to check if split_state() returned an error twice, instead
unify into a single if statement after setting 'prealloc' to NULL, because
on error split_state() frees the 'prealloc' extent state record.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Filipe Manana 2025-04-10 16:40:29 +01:00 committed by David Sterba
parent f2a24bef55
commit 5f9c554a6c

View File

@ -1389,11 +1389,11 @@ int btrfs_convert_extent_bit(struct extent_io_tree *tree, u64 start, u64 end,
goto out;
}
ret = split_state(tree, state, prealloc, start);
if (ret)
extent_io_tree_panic(tree, state, "split", ret);
prealloc = NULL;
if (ret)
if (ret) {
extent_io_tree_panic(tree, state, "split", ret);
goto out;
}
if (state->end <= end) {
set_state_bits(tree, state, bits, NULL);
cache_state(state, cached_state);