mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 19:34:43 +01:00
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
This commit is contained in:
1 parent
5c30b24381
commit
ddf28f27c5
1 file changed
+1
-1
@@ -659,7 +659,7 @@ zfs_range_tree_find_in(zfs_range_tree_t *rt, uint64_t start, uint64_t size,
|
||||
}
|
||||
|
||||
rs = zfs_btree_next(&rt->rt_root, &where, &where);
|
||||
if (rs == NULL || zfs_rs_get_start(rs, rt) > start + size)
|
||||
if (rs == NULL || zfs_rs_get_start(rs, rt) >= start + size)
|
||||
return (B_FALSE);
|
||||
|
||||
*ostart = zfs_rs_get_start(rs, rt);
|
||||
|
||||
Reference in new issue
Block a user