]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
btrfs: remove duplicate error check at btrfs_clear_extent_bit_changeset()
authorFilipe Manana <fdmanana@suse.com>
Wed, 9 Apr 2025 14:27:35 +0000 (15:27 +0100)
committerDavid Sterba <dsterba@suse.com>
Thu, 15 May 2025 12:30:50 +0000 (14:30 +0200)
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>
fs/btrfs/extent-io-tree.c

index 9f4f5829c55ca6fd77fddf57777ce2220d903848..15400a0f899c9651151f560be7c10975d864059b 100644 (file)
@@ -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;