• Nikolay Borisov's avatar
    btrfs: Remove 1st shrink/grow phase from balance · 15c82763
    Nikolay Borisov authored
    The first step of the rebalance process ensures there is 1MiB free on
    each device. This number seems rather small. And in fact when talking to
    the original authors their opinions were:
    
    "man that's a little bonkers"
    "i don't think we even need that code anymore"
    "I think it was there to make sure we had room for the blank 1M at the
    beginning. I bet it goes all the way back to v0"
    "we just don't need any of that tho, i say we just delete it"
    
    Clearly, this piece of code has lost its original intent throughout the
    years. It doesn't really bring any real practical benefits to the
    relocation process.
    
    Additionally, this patch makes the balance process more lightweight by
    removing a pair of shrink/grow operations which are rather expensive for
    heavily populated filesystems. This is mainly due to shrink requiring
    relocating block groups, involving heavy use of the btree.
    
    The intermediate shrink/grow can fail and leave the filesystem in a
    middle state that would need to be changed back by the user.
    Suggested-by: default avatarJosef Bacik <josef@toxicpanda.com>
    Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
    Signed-off-by: default avatarNikolay Borisov <nborisov@suse.com>
    [ update changelog ]
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    15c82763
volumes.c 210 KB