]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: if we're restriping, use the target restripe profile
authorJosef Bacik <josef@toxicpanda.com>
Tue, 21 Jul 2020 14:48:46 +0000 (10:48 -0400)
committerDavid Sterba <dsterba@suse.com>
Mon, 27 Jul 2020 10:55:47 +0000 (12:55 +0200)
commit47ec1707470f3753208906942e23dba5c111ac73
tree5e637f16ec455e25ae80f18b2d7dd22f323ee5ae
parent8bd4e79bc3f6f812d4009861d519cb44a9e45536
btrfs: if we're restriping, use the target restripe profile

Previously we depended on some weird behavior in our chunk allocator to
force the allocation of new stripes, so by the time we got to doing the
reduce we would usually already have a chunk with the proper target.

However that behavior causes other problems and needs to be removed.
First however we need to remove this check to only restripe if we
already have those available profiles, because if we're allocating our
first chunk it obviously will not be available.  Simply use the target
as specified, and if that fails it'll be because we're out of space.

Tested-by: Holger Hoffstätte <holger@applied-asynchrony.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/block-group.c