• N
    btrfs: zoned: unset dedicated block group on allocation failure · 1ada69f6
    Naohiro Aota 提交于
    Allocating an extent from a block group can fail for various reasons.
    When an allocation from a dedicated block group (for tree-log or
    relocation data) fails, we need to unregister it as a dedicated one so
    that we can allocate a new block group for the dedicated one.
    
    However, we are returning early when the block group in case it is
    read-only, fully used, or not be able to activate the zone. As a result,
    we keep the non-usable block group as a dedicated one, leading to
    further allocation failure. With many block groups, the allocator will
    iterate hopeless loop to find a free extent, results in a hung task.
    
    Fix the issue by delaying the return and doing the proper cleanups.
    
    CC: stable@vger.kernel.org # 5.16
    Signed-off-by: NNaohiro Aota <naohiro.aota@wdc.com>
    Signed-off-by: NDavid Sterba <dsterba@suse.com>
    1ada69f6
extent-tree.c 166.3 KB