Fix incorrect splits/merges in the memory tree when madvise() fails.

ibv_madvise_range() first manages (splits or merges) memory ranges in
the tree and only then calls madvise().  If madvise() fails, the
tree's memory range may contain incorrectly split or merged ranges.
The patch undoes the split and merge operations performed on the node
which caused the madvise() failure as well as on that node's
neighbors.

Signed-off-by: Alex Vainman <alexv@voltaire.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
1 file changed