• Joe Thornber's avatar
    dm thin metadata: fix bug in dm_thin_remove_range() · 993ceab9
    Joe Thornber authored
    dm_btree_remove_leaves() only unmaps a contiguous region so we need a
    loop, in __remove_range(), to handle ranges that contain multiple
    regions.
    
    A new btree function, dm_btree_lookup_next(), is introduced which is
    more efficiently able to skip over regions of the thin device which
    aren't mapped.  __remove_range() uses dm_btree_lookup_next() for each
    iteration of __remove_range()'s loop.
    
    Also, improve description of dm_btree_remove_leaves().
    
    Fixes: 6550f075 ("dm thin metadata: add dm_thin_remove_range()")
    Signed-off-by: default avatarJoe Thornber <ejt@redhat.com>
    Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
    Cc: stable@vger.kernel.org # 4.1+
    993ceab9
dm-btree.h 5.2 KB