From: Filipe Manana Date: Thu, 10 Apr 2025 15:40:29 +0000 (+0100) Subject: btrfs: remove duplicate error check at btrfs_convert_extent_bit() X-Git-Tag: v6.16-rc1~214^2~70 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5f9c554a6c1219dee1a3484db2e19881d35a0788;p=thirdparty%2Flinux.git 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 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 55334c616d6dc..2c004e0c431d8 100644 --- a/fs/btrfs/extent-io-tree.c +++ b/fs/btrfs/extent-io-tree.c @@ -1389,11 +1389,11 @@ hit_next: 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);