Undo changes in memory range tree when madvise() fails

ibv_madvise_range() doesn't cleanup if madvise() fails.  This patch
rolls back changes already made in the memory range tracking tree by
madvise() calls before the one that failed.  We can do this fairly
simply by simply restarting ibv_madvise_range() from the original
start to the current location with the opposite advice/inc values.

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