Skip to content

Commit

Permalink
Recursive range_tree_add was broken AF.
Browse files Browse the repository at this point in the history
  • Loading branch information
skiselkov committed Mar 16, 2017
1 parent 9b88145 commit e903501
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions usr/src/uts/common/fs/zfs/range_tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,14 @@ range_tree_add_fill(void *arg, uint64_t start, uint64_t size, uint64_t fill)
return;
}
ASSERT0(fill);
if (rs->rs_start < start)
range_tree_add(rt, rs->rs_end, end);
else
range_tree_add(rt, start, rs->rs_start);
if (rs->rs_start < start) {
ASSERT3U(end, >, rs->rs_end);
range_tree_add(rt, rs->rs_end, end -
rs->rs_end);
} else {
ASSERT3U(rs->rs_start, >, start);
range_tree_add(rt, start, rs->rs_start - start);
}
return;
}
} else {
Expand Down

0 comments on commit e903501

Please sign in to comment.