diff options
author | Filipe Manana <fdmanana@suse.com> | 2025-04-09 15:27:35 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2025-05-15 14:30:50 +0200 |
commit | f389e7b982a14421dc6ec935552c39ea23da2f43 (patch) | |
tree | fe30634cf9b3b5958f01df5b336ccf4f1c20715d | |
parent | 007fa63225683f540456a631045de681473d31d5 (diff) |
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>
-rw-r--r-- | fs/btrfs/extent-io-tree.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/btrfs/extent-io-tree.c b/fs/btrfs/extent-io-tree.c index 9f4f5829c55c..15400a0f899c 100644 --- a/fs/btrfs/extent-io-tree.c +++ b/fs/btrfs/extent-io-tree.c @@ -691,12 +691,11 @@ hit_next: 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; |