• Ilya Dryomov's avatar
    Btrfs: improve the logic in btrfs_can_relocate() · 4a5e98f5
    Ilya Dryomov authored
    Currently if we don't have enough space allocated we go ahead and loop
    though devices in the hopes of finding enough space for a chunk of the
    *same* type as the one we are trying to relocate.  The problem with that
    is that if we are trying to restripe the chunk its target type can be
    more relaxed than the current one (eg require less devices or less
    space).  So, when restriping, run checks against the target profile
    instead of the current one.
    Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
    4a5e98f5
extent-tree.c 209 KB