From: Filipe Manana Date: Wed, 9 Apr 2025 14:27:35 +0000 (+0100) Subject: btrfs: remove duplicate error check at btrfs_clear_extent_bit_changeset() X-Git-Tag: v6.16-rc1~214^2~76 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f389e7b982a14421dc6ec935552c39ea23da2f43;p=thirdparty%2Flinux.git 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 Reviewed-by: David Sterba Signed-off-by: David Sterba --- diff --git a/fs/btrfs/extent-io-tree.c b/fs/btrfs/extent-io-tree.c index 9f4f5829c55ca..15400a0f899c9 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;