• Qu Wenruo's avatar
    btrfs: volumes: Add comment for find_free_dev_extent_start() · 135da976
    Qu Wenruo authored
    Since commit 6df9a95e ("Btrfs: make the chunk allocator completely
    tree lockless") we search commit root of device tree to avoid deadlock.
    
    This introduced a safety feature, find_free_dev_extent_start() won't
    use dev extents which just get freed in current transaction.
    
    This safety feature makes sure we won't allocate new block group using
    just freed dev extents to break CoW.
    
    However, this feature also makes find_free_dev_extent_start() not
    reliable reporting free device space.  Just add such comment to make
    later viewer careful about this behavior.
    
    This behavior makes one caller, btrfs_can_relocate() unreliable
    determining the device free space.
    Reviewed-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
    Signed-off-by: default avatarQu Wenruo <wqu@suse.com>
    Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    135da976
volumes.c 206 KB