btrfs: Remove 1st shrink/grow phase from balance
authorNikolay Borisov <nborisov@suse.com>
Wed, 5 Dec 2018 08:48:50 +0000 (10:48 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 17 Dec 2018 13:51:49 +0000 (14:51 +0100)
commit15c8276302c42ebf704b44578f25bc35dfdbde24
tree960231285883aea71f79c4c44bffffa4cee9b61d
parentbe6821f82c3cc36e026f5afd10249988852b35ea
btrfs: Remove 1st shrink/grow phase from balance

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: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
[ update changelog ]
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/volumes.c