]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: do not create empty block group if we have allocated data
authorLiu Bo <bo.li.liu@oracle.com>
Tue, 15 Dec 2015 02:29:32 +0000 (18:29 -0800)
committerDavid Sterba <dsterba@suse.com>
Thu, 28 Apr 2016 08:41:47 +0000 (10:41 +0200)
commit605482f82299a8b5f18ecb369af96ea464fb4c15
tree4584b2acab4763b669af76859d63e17758623782
parenta3994e303cfeca9526e79b132de9fb3b844be08b
Btrfs: do not create empty block group if we have allocated data

Now we force to create empty block group to keep data profile alive,
however, in the below example, we eventually get an empty block group
while we're trying to get more space for other types (metadata/system),

- Before,
block group "A": size=2G, used=1.2G
block group "B": size=2G, used=512M

- After "btrfs balance start -dusage=50 mount_point",
block group "A": size=2G, used=(1.2+0.5)G
block group "C": size=2G, used=0

Since there is no data in block group C, it won't be deleted
automatically and we have to get the unused 2G until the next mount.

Balance itself just moves data and doesn't remove data, so it's safe
to not create such a empty block group if we already have data
 allocated in other block groups.

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/volumes.c