• Joe Thornber's avatar
    dm persistent data: fix btree rebalancing after remove · b0988900
    Joe Thornber authored
    When we remove an entry from a node we sometimes rebalance with it's
    two neighbours.  This wasn't being done correctly; in some cases
    entries have to move all the way from the right neighbour to the left
    neighbour, or vice versa.  This patch pretty much re-writes the
    balancing code to fix it.
    
    This code is barely used currently; only when you delete a thin
    device, and then only if you have hundreds of them in the same pool.
    Once we have discard support, which removes mappings, this will be used
    much more heavily.
    Signed-off-by: default avatarJoe Thornber <ejt@redhat.com>
    Cc: stable@kernel.org
    Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
    Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
    b0988900
dm-btree-remove.c 14.7 KB