Skip to content

Commit 5911f53

Browse files
morbidrsakdave
authored andcommitted
btrfs: zoned: clear data relocation bg on zone finish
When finishing a zone that is used by a dedicated data relocation block group, also remove its reference from fs_info, so we're not trying to use a full block group for allocations during data relocation, which will always fail. The result is we're not making any forward progress and end up in a deadlock situation. Fixes: c2707a2 ("btrfs: zoned: add a dedicated data relocation block group") Reviewed-by: Naohiro Aota <[email protected]> Signed-off-by: Johannes Thumshirn <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent da5e817 commit 5911f53

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/btrfs/zoned.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1860,6 +1860,7 @@ int btrfs_zone_finish(struct btrfs_block_group *block_group)
18601860
block_group->alloc_offset = block_group->zone_capacity;
18611861
block_group->free_space_ctl->free_space = 0;
18621862
btrfs_clear_treelog_bg(block_group);
1863+
btrfs_clear_data_reloc_bg(block_group);
18631864
spin_unlock(&block_group->lock);
18641865

18651866
ret = blkdev_zone_mgmt(device->bdev, REQ_OP_ZONE_FINISH,
@@ -1942,6 +1943,7 @@ void btrfs_zone_finish_endio(struct btrfs_fs_info *fs_info, u64 logical, u64 len
19421943
ASSERT(block_group->alloc_offset == block_group->zone_capacity);
19431944
ASSERT(block_group->free_space_ctl->free_space == 0);
19441945
btrfs_clear_treelog_bg(block_group);
1946+
btrfs_clear_data_reloc_bg(block_group);
19451947
spin_unlock(&block_group->lock);
19461948

19471949
map = block_group->physical_map;

0 commit comments

Comments
 (0)