range_tree: use zfs_panic_recover() for partial-overlap remove

zfs_range_tree_remove_impl() used a bare panic() when a segment to be
removed was not completely overlapped by an existing tree entry.  Every
other consistency check in range_tree.c uses zfs_panic_recover(), which
respects the zfs_recover tunable and allows pools with on-disk
corruption to be imported and recovered.  This one call was
inconsistent, making the partial-overlap case unrecoverable regardless
of zfs_recover.

Replace panic() with zfs_panic_recover() so that operators can set
zfs_recover=1 to import a corrupted pool and reclaim data, consistent
with all other range tree error paths.

Related-to: https://github.com/openzfs/zfs/issues/13483
Reviewed-by: Tony Hutter <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Clemens Fruhwirth <[email protected]>
Co-authored-by: Claude Sonnet 4.6 <[email protected]>
Closes #18255
This commit is contained in:
clefru authored and GitHub committed 2026-02-25 11:26:10 -08:00
1 parent 4da3f059a3
commit 6495dafd58
1 file changed
+1 -1
+1 -1
View File
@@ -539,7 +539,7 @@ zfs_range_tree_remove_impl(zfs_range_tree_t *rt, uint64_t start, uint64_t size,
}
if (!(rstart <= start && rend >= end)) {
panic("zfs: rt=%s: removing segment "
zfs_panic_recover("zfs: rt=%s: removing segment "
"(offset=%llx size=%llx) not completely overlapped by "
"existing one (offset=%llx size=%llx)",
ZFS_RT_NAME(rt),