Skip to content

Commit ddf28f2

Browse files
authored
Fix off-by-one bug in range tree code
Without this fix, zfs_range_tree_find_in could return an overlap when the found range starts immediately after the searched range, with no actual overlap. Sponsored-by: Klara, Inc. Sponsored-by: Wasabi Technology, Inc. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Reviewed by: Igor Kozhukhov <[email protected]> Signed-off-by: Paul Dagnelie <[email protected]> Closes #17363
1 parent 5c30b24 commit ddf28f2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

module/zfs/range_tree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ zfs_range_tree_find_in(zfs_range_tree_t *rt, uint64_t start, uint64_t size,
659659
}
660660

661661
rs = zfs_btree_next(&rt->rt_root, &where, &where);
662-
if (rs == NULL || zfs_rs_get_start(rs, rt) > start + size)
662+
if (rs == NULL || zfs_rs_get_start(rs, rt) >= start + size)
663663
return (B_FALSE);
664664

665665
*ostart = zfs_rs_get_start(rs, rt);

0 commit comments

Comments
 (0)