• S
    btrfs: delete chunk allocation attemp when setting block group ro · 2f081088
    Shaohua Li 提交于
    Below test will fail currently:
          mkfs.ext4 -F /dev/sda
          btrfs-convert /dev/sda
          mount /dev/sda /mnt
          btrfs device add -f /dev/sdb /mnt
          btrfs balance start -v -dconvert=raid1 -mconvert=raid1 /mnt
    
    The reason is there are some block groups with usage 0, but the whole
    disk hasn't free space to allocate new chunk, so we even can't set such
    block group readonly. This patch deletes the chunk allocation when
    setting block group ro. For META, we already have reserve. But for
    SYSTEM, we don't have, so the check_system_chunk is still required.
    Signed-off-by: NShaohua Li <shli@fb.com>
    Signed-off-by: NChris Mason <clm@fb.com>
    2f081088
extent-tree.c 260.7 KB