btrfs: convert BUG_ON in btrfs_reloc_cow_block() to proper error handling

[ Upstream commit 6a4730b325 ]

This BUG_ON is meant to catch backref cache problems, but these can
arise from either bugs in the backref cache or corruption in the extent
tree.  Fix it to be a proper error.

Reviewed-by: Boris Burkov <boris@bur.io>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Josef Bacik 2024-10-03 11:43:03 -04:00 • committed by Greg Kroah-Hartman
commit 13dae4fa17