btrfs: remove duplicate error check at btrfs_clear_extent_bit_changeset()

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-09 15:27:35 +01:00
committed by David Sterba
parent 007fa63225
commit f389e7b982

View File

@@ -691,12 +691,11 @@ int btrfs_clear_extent_bit_changeset(struct extent_io_tree *tree, u64 start, u64
if (!prealloc)
goto search_again;
err = split_state(tree, state, prealloc, start);
if (err)
extent_io_tree_panic(tree, state, "split", err);
prealloc = NULL;
if (err)
if (err) {
extent_io_tree_panic(tree, state, "split", err);
goto out;
}
if (state->end <= end) {
state = clear_state_bit(tree, state, bits, wake, changeset);
goto next;